From c9ca59dedfc54079be619826cd06aa1686d0bb10 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Tue, 30 Jan 2024 10:17:53 -0500 Subject: [PATCH] patch rippling sso --- backend/src/ee/routes/v1/saml-router.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/ee/routes/v1/saml-router.ts b/backend/src/ee/routes/v1/saml-router.ts index a8e29d08cc..96ee2408db 100644 --- a/backend/src/ee/routes/v1/saml-router.ts +++ b/backend/src/ee/routes/v1/saml-router.ts @@ -71,9 +71,12 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => { try { const serverCfg = getServerCfg(); if (!profile) throw new BadRequestError({ message: "Missing profile" }); - const { email, firstName } = profile; - if (!email || !firstName) + const { firstName } = profile; + const email = profile?.email ?? profile?.emailAddress as string // emailRippling is added because in Rippling the field `email` reserved + + if (!email || !firstName){ throw new BadRequestError({ message: "Invalid request. Missing email or first name" }); + } const { isUserCompleted, providerAuthToken } = await server.services.saml.samlLogin({ email,