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
10a68619
Commit
10a68619
authored
2 years ago
by
Guilhem CARRON
Browse files
Options
Downloads
Patches
Plain Diff
edit local conf for onDelete
parent
56459d1c
No related branches found
No related tags found
1 merge request
!19
Feat/us858 save expiration date
Pipeline
#42584
failed
2 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/helpers/env.js
+6
-3
6 additions, 3 deletions
src/helpers/env.js
src/onDeleteAccount.js
+4
-4
4 additions, 4 deletions
src/onDeleteAccount.js
with
10 additions
and
7 deletions
src/helpers/env.js
+
6
−
3
View file @
10a68619
...
...
@@ -10,8 +10,11 @@ function isLocal() {
* Verify if it's an alpha URL
* @returns {boolean}
*/
function
isAlpha
()
{
return
process
.
env
.
COZY_URL
.
includes
(
'
alpha
'
)
function
isDev
()
{
return
(
process
.
env
.
COZY_URL
.
includes
(
'
alpha
'
)
||
process
.
env
.
COZY_URL
.
includes
(
'
cozy.tools
'
)
)
}
module
.
exports
=
{
isLocal
,
is
Alpha
}
module
.
exports
=
{
isLocal
,
is
Dev
}
This diff is collapsed.
Click to expand it.
src/onDeleteAccount.js
+
4
−
4
View file @
10a68619
...
...
@@ -12,8 +12,7 @@ const moment = require('moment')
require
(
'
moment-timezone
'
)
moment
.
locale
(
'
fr
'
)
// set the language
moment
.
tz
.
setDefault
(
'
Europe/Paris
'
)
// set the timezone
const
{
isLocal
,
isAlpha
}
=
require
(
'
./helpers/env
'
)
// const ACCOUNT_ID = isLocal() ? 'default_account_id' : 'enedis-sge-grandlyon'
const
{
isLocal
,
isDev
}
=
require
(
'
./helpers/env
'
)
async
function
onDeleteAccount
()
{
log
(
'
info
'
,
'
Deleting account ...
'
)
...
...
@@ -36,13 +35,14 @@ async function onDeleteAccount() {
})
}
const
secrets
=
getAccountSecret
()
log
(
'
warn
'
,
`Account DATAA InOndelete
${
JSON
.
stringify
(
accountData
)}
`
)
const
userConsent
=
await
getBoConsent
(
secrets
.
boBaseUrl
,
secrets
.
boToken
,
accountData
.
data
.
consentId
)
log
(
'
info
'
,
`isAlpha:
${
is
Alpha
()}
`
)
log
(
'
info
'
,
`isAlpha:
${
is
Dev
()}
`
)
log
(
'
info
'
,
`userConsent:
${
JSON
.
stringify
(
userConsent
)}
`
)
if
(
userConsent
.
ID
&&
userConsent
.
pointID
)
{
log
(
'
log
'
,
`Consent
${
userConsent
.
ID
}
found for user`
)
...
...
@@ -53,7 +53,7 @@ async function onDeleteAccount() {
userConsent
.
ID
)
// Verify if it's dev env to prevent delete of real data
if
(
!
is
Alpha
())
{
if
(
!
is
Dev
())
{
await
terminateContract
(
secrets
.
wso2BaseUrl
,
secrets
.
apiToken
,
...
...
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