Added OAUTH2_USER_ATTR_EMAIL_APPEND

This commit is contained in:
Maxime FRIESS 2024-03-24 19:11:25 +01:00
parent 86a90ac4f6
commit eeb4816293
No known key found for this signature in database
GPG Key ID: 5294B3B26FA19584
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
268a268,364
268a269,365
>
> // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> oauth2Redirect(req, res, next) {
@ -62,7 +62,7 @@
> const profile = await profileResponse.json()
> console.log("OAuth2 user profile", JSON.stringify(profile))
>
> const email = profile[process.env.OAUTH2_USER_ATTR_EMAIL ?? "email"]
> const email = profile[process.env.OAUTH2_USER_ATTR_EMAIL ?? "email"] + (process.env.OAUTH2_USER_ATTR_EMAIL_APPEND ?? '')
> const uid = profile[process.env.OAUTH2_USER_ATTR_UID ?? "uid"]
> const firstname = profile?.[process.env.OAUTH2_USER_ATTR_FIRSTNAME] ?? email
> const lastname = process.env.OAUTH2_USER_ATTR_LASTNAME