From 8893aec213b58dca4595300c51bbf546c25c67a9 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Tue, 23 Jan 2024 01:10:59 -0500 Subject: [PATCH] patch saml sso for rippling --- backend/src/utils/authn/passport/saml.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/utils/authn/passport/saml.ts b/backend/src/utils/authn/passport/saml.ts index d6f22e672..74a2242e2 100644 --- a/backend/src/utils/authn/passport/saml.ts +++ b/backend/src/utils/authn/passport/saml.ts @@ -76,10 +76,10 @@ export const initializeSamlStrategy = async () => { if (!organization) return done(OrganizationNotFoundError()); - const email = profile.email; + const email = profile?.email ?? profile?.emailAddress // emailRippling is added because in Rippling the field `email` reserved const firstName = profile.firstName; const lastName = profile.lastName; - + let user = await User.findOne({ email }).select("+publicKey");