Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
enedis_sge_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
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
enedis_sge_konnector
Commits
5fdbe11a
Commit
5fdbe11a
authored
1 year ago
by
Rémi PAILHAREY
Browse files
Options
Downloads
Patches
Plain Diff
fix: TERMS_VERSION_MISMATCH error
parent
a3ec6009
No related branches found
No related tags found
2 merge requests
!56
v1.4.0
,
!55
fix: TERMS_VERSION_MISMATCH error
Pipeline
#93846
passed
1 year ago
Stage: test
Stage: build
Stage: update-instances
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/core/verifyUserIdentity.spec.js
+2
-2
2 additions, 2 deletions
__tests__/core/verifyUserIdentity.spec.js
src/core/verifyUserIdentity.js
+5
-3
5 additions, 3 deletions
src/core/verifyUserIdentity.js
with
7 additions
and
5 deletions
__tests__/core/verifyUserIdentity.spec.js
+
2
−
2
View file @
5fdbe11a
...
@@ -39,7 +39,7 @@ describe('verifyUserIdentity', () => {
...
@@ -39,7 +39,7 @@ describe('verifyUserIdentity', () => {
}
}
})
})
it
(
'
should throw
TERMS_VERSION_MISMATCH
when pdl give and received are NOT matching on alternate start 🚫
'
,
async
()
=>
{
it
(
'
should throw
USER_ACTION_NEEDED_PERMISSIONS_CHANGED
when pdl give and received are NOT matching on alternate start 🚫
'
,
async
()
=>
{
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
findUserPdl
.
mockResolvedValueOnce
(
'
12345
'
)
try
{
try
{
await
verifyUserIdentity
(
await
verifyUserIdentity
(
...
@@ -56,7 +56,7 @@ describe('verifyUserIdentity', () => {
...
@@ -56,7 +56,7 @@ describe('verifyUserIdentity', () => {
)
)
expect
(
true
).
toBe
(
false
)
expect
(
true
).
toBe
(
false
)
}
catch
(
error
)
{
}
catch
(
error
)
{
expect
(
error
.
message
).
toBe
(
errors
.
TERMS_VERSION_MISMATCH
)
expect
(
error
.
message
).
toBe
(
errors
.
USER_ACTION_NEEDED_PERMISSIONS_CHANGED
)
}
}
})
})
...
...
This diff is collapsed.
Click to expand it.
src/core/verifyUserIdentity.js
+
5
−
3
View file @
5fdbe11a
...
@@ -67,7 +67,7 @@ async function verifyUserIdentity(
...
@@ -67,7 +67,7 @@ async function verifyUserIdentity(
userAddress
.
escalierEtEtageEtAppartement
userAddress
.
escalierEtEtageEtAppartement
?
removeMultipleSpaces
(
userAddress
.
escalierEtEtageEtAppartement
)
?
removeMultipleSpaces
(
userAddress
.
escalierEtEtageEtAppartement
)
:
''
:
''
// Second try, trim whitespace
pdl
=
await
findUserPdl
(
pdl
=
await
findUserPdl
(
`
${
baseUrl
}
/enedis_SDE_recherche-point/1.0`
,
`
${
baseUrl
}
/enedis_SDE_recherche-point/1.0`
,
apiAuthKey
,
apiAuthKey
,
...
@@ -134,13 +134,15 @@ async function verifyUserIdentity(
...
@@ -134,13 +134,15 @@ async function verifyUserIdentity(
log
(
'
error
'
,
'
PointId does not match
'
)
log
(
'
error
'
,
'
PointId does not match
'
)
if
(
isAlternateStart
)
{
if
(
isAlternateStart
)
{
Sentry
.
captureException
(
'
PointId
does not match: Alternate start
'
,
{
Sentry
.
captureException
(
'
PointId
no longer match
'
,
{
tags
:
{
section
:
'
verifyUserIdentity
'
},
tags
:
{
section
:
'
verifyUserIdentity
'
},
extra
:
{
foundPdl
:
pdl
},
})
})
throw
new
Error
(
errors
.
TERMS_VERSION_MISMATCH
)
throw
new
Error
(
errors
.
USER_ACTION_NEEDED_PERMISSIONS_CHANGED
)
}
else
{
}
else
{
Sentry
.
captureException
(
'
PointId does not match
'
,
{
Sentry
.
captureException
(
'
PointId does not match
'
,
{
tags
:
{
section
:
'
verifyUserIdentity
'
},
tags
:
{
section
:
'
verifyUserIdentity
'
},
extra
:
{
foundPdl
:
pdl
},
})
})
throw
new
Error
(
errors
.
LOGIN_FAILED
)
throw
new
Error
(
errors
.
LOGIN_FAILED
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
a0ad6a5b
·
1 year ago
mentioned in commit
a0ad6a5b
mentioned in commit a0ad6a5b03fe2fef62453295c46436e2ea882974
Toggle commit list
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