Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grdf_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
grdf_konnector
Commits
02b2ebdb
Commit
02b2ebdb
authored
1 year ago
by
Bastien DUMONT
Browse files
Options
Downloads
Patches
Plain Diff
fix: missing pce when coming from client connect
parent
fa0cdd00
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!43
Merge dev into master
,
!34
2.0.3 Release
,
!33
fix: missing pce when coming from client connect
Pipeline
#101711
passed
1 year ago
Stage: test
Stage: build
Stage: push-build
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/index.js
+11
-1
11 additions, 1 deletion
src/index.js
src/types.ts
+4
-0
4 additions, 0 deletions
src/types.ts
with
15 additions
and
1 deletion
src/index.js
+
11
−
1
View file @
02b2ebdb
...
...
@@ -80,7 +80,12 @@ async function start(fields, cozyParameters) {
)
}
const
{
pce
,
email
,
firstname
,
lastname
,
postalCode
}
=
fields
let
{
pce
,
email
,
firstname
,
lastname
,
postalCode
}
=
fields
if
(
!
pce
&&
fields
?.
oauth_callback_results
?.
pce
)
{
pce
=
fields
.
oauth_callback_results
.
pce
log
(
'
info
'
,
`OAuth callback result found, using pce
${
pce
}
`
)
}
const
transaction
=
Sentry
.
startTransaction
({
op
:
'
konnector
'
,
...
...
@@ -102,6 +107,11 @@ async function start(fields, cozyParameters) {
const
boUrlGRDF
=
new
URL
(
'
/api/grdf
'
,
boBaseUrl
).
href
try
{
if
(
!
pce
)
{
log
(
'
error
'
,
'
No PCE found
'
)
throw
errors
.
VENDOR_DOWN
}
log
(
'
info
'
,
`using PCE:
${
pce
}
`
)
const
{
access_token
}
=
await
getAuthToken
(
grdfId
,
grdfSecret
)
const
consents
=
await
getConsents
(
access_token
,
pce
)
const
noValidConsent
=
await
handleConsents
(
consents
,
boUrlGRDF
,
boToken
)
...
...
This diff is collapsed.
Click to expand it.
src/types.ts
+
4
−
0
View file @
02b2ebdb
...
...
@@ -44,6 +44,10 @@ export type fields = {
lastname
:
string
firstname
:
string
postalCode
:
string
/** previous PCE from oauth stored in account */
oauth_callback_results
?:
{
pce
?:
string
}
}
/** Cozy parameters definition */
...
...
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