Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis-konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis-konnector
Commits
a40bf58c
Commit
a40bf58c
authored
3 years ago
by
unknown
Browse files
Options
Downloads
Patches
Plain Diff
used to throw login_failed when out of consent, now oauth_outdated
parent
81c20d5d
No related branches found
Branches containing commit
No related tags found
1 merge request
!14
throw oauth_action_needed instead of login_failed when consent is KO
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
manifest.konnector
+1
-1
1 addition, 1 deletion
manifest.konnector
package.json
+1
-1
1 addition, 1 deletion
package.json
src/index.js
+7
-3
7 additions, 3 deletions
src/index.js
with
9 additions
and
5 deletions
manifest.konnector
+
1
−
1
View file @
a40bf58c
{
"version": "1.1.
1
",
"version": "1.1.
2
",
"name": "Enedis",
"type": "konnector",
"language": "node",
...
...
This diff is collapsed.
Click to expand it.
package.json
+
1
−
1
View file @
a40bf58c
{
"name"
:
"enedis"
,
"version"
:
"1.1.
1
"
,
"version"
:
"1.1.
2
"
,
"description"
:
""
,
"repository"
:
{
"type"
:
"git"
,
...
...
This diff is collapsed.
Click to expand it.
src/index.js
+
7
−
3
View file @
a40bf58c
...
...
@@ -98,7 +98,7 @@ async function start(fields, cozyParameters, doRetry = true) {
}
catch
(
err
)
{
if
(
err
.
statusCode
===
403
||
err
.
code
===
403
)
{
if
(
!
fields
.
refresh_token
)
{
log
(
'
info
'
,
'
no refresh token found
'
)
log
(
'
debug
'
,
'
no refresh token found
'
)
throw
errors
.
USER_ACTION_NEEDED_OAUTH_OUTDATED
}
else
if
(
doRetry
)
{
log
(
'
info
'
,
'
asking refresh from the stack
'
)
...
...
@@ -109,7 +109,7 @@ async function start(fields, cozyParameters, doRetry = true) {
`/accounts/enedisgrandlyon/
${
accountId
}
/refresh`
)
}
catch
(
err
)
{
log
(
'
info
'
,
`Error during refresh
${
err
.
message
}
`
)
log
(
'
debug
'
,
`Error during refresh
${
err
.
message
}
`
)
throw
errors
.
USER_ACTION_NEEDED_OAUTH_OUTDATED
}
log
(
'
info
'
,
'
refresh response
'
)
...
...
@@ -118,7 +118,11 @@ async function start(fields, cozyParameters, doRetry = true) {
fields
.
usage_point_id
=
usage_point_id
return
start
(
fields
,
cozyParameters
,
false
)
}
log
(
'
error
'
,
`Error during authentication:
${
err
.
message
}
`
)
if
(
err
.
message
.
search
(
'
ADAM-DC-0008
'
)
>
0
)
{
log
(
'
debug
'
,
'
No consent can be found for this customer and this usage point
'
)
throw
errors
.
USER_ACTION_NEEDED_OAUTH_OUTDATED
}
log
(
'
error
'
,
`Error during authentication:
${
err
.
message
}
`
)
throw
errors
.
LOGIN_FAILED
}
else
{
log
(
'
error
'
,
'
caught an unexpected error
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment