diff --git a/backend/src/ee/routes/v1/saml-router.ts b/backend/src/ee/routes/v1/saml-router.ts index 09dc3247c..fe387143e 100644 --- a/backend/src/ee/routes/v1/saml-router.ts +++ b/backend/src/ee/routes/v1/saml-router.ts @@ -99,14 +99,15 @@ export const registerSamlRouter = async (server: FastifyZodProvider) => { async (req, profile, cb) => { try { if (!profile) throw new BadRequestError({ message: "Missing profile" }); + const email = profile?.email ?? (profile?.emailAddress as string); // emailRippling is added because in Rippling the field `email` reserved - if (!profile.nameID || !profile.firstName) { + if (!profile.email || !profile.firstName) { throw new BadRequestError({ message: "Invalid request. Missing email or first name" }); } const { isUserCompleted, providerAuthToken } = await server.services.saml.samlLogin({ - username: profile.nameID, - email: profile.email, + username: profile.nameID ?? email, + email, firstName: profile.firstName as string, lastName: profile.lastName as string, relayState: (req.body as { RelayState?: string }).RelayState, diff --git a/frontend/src/layouts/AdminLayout/AdminLayout.tsx b/frontend/src/layouts/AdminLayout/AdminLayout.tsx index 0e38c9a13..ad728dbae 100644 --- a/frontend/src/layouts/AdminLayout/AdminLayout.tsx +++ b/frontend/src/layouts/AdminLayout/AdminLayout.tsx @@ -121,7 +121,7 @@ export const AdminLayout = ({ children }: LayoutProps) => { -
{user?.email}
+
{user.username}
Personal Settings diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index 341dc68dc..8df1d15d2 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -291,7 +291,7 @@ export const AppLayout = ({ children }: LayoutProps) => { -
{user?.email}
+
{user?.username}
{orgs?.map((org) => { return ( @@ -366,7 +366,7 @@ export const AppLayout = ({ children }: LayoutProps) => { -
{user?.email}
+
{user?.username}
Personal Settings