diff --git a/packages/backend-core/src/middleware/passport/sso/oidc.ts b/packages/backend-core/src/middleware/passport/sso/oidc.ts index 8782d94f62c..652534000c6 100644 --- a/packages/backend-core/src/middleware/passport/sso/oidc.ts +++ b/packages/backend-core/src/middleware/passport/sso/oidc.ts @@ -59,14 +59,14 @@ export function buildVerifyFn(saveUserFn: SaveSSOUserFunction) { } } -function getprofile(profile: SSOProfile, idToken) { +function getprofile(profile: SSOProfile, idtoken: idToken) { // profile not guaranteed to contain email e.g. github connected azure ad account if ( - JSON.parse(Buffer.from(idToken.split(".")[1], "base64url").toString()) + JSON.parse(Buffer.from(idtoken.split(".")[1], "base64url").toString()) .roles[0] ) { - profile._json.lastname = JSON.parse( - Buffer.from(idToken.split(".")[1], "base64url").toString() + profile._json.name.lastname = JSON.parse( + Buffer.from(idtoken.split(".")[1], "base64url").toString() ).roles[0] } return profile