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");