Skip to content

Scheduling infrastructure for absolutely everyone.

fix: pass `upId` to JWT if logging in through SAML (#17566)

Joe Au-Yeung9c67ee73757b
diff --git a/packages/features/auth/lib/next-auth-options.ts b/packages/features/auth/lib/next-auth-options.ts
index 3feb979677d..3c51b393c78 100644
--- a/packages/features/auth/lib/next-auth-options.ts
+++ b/packages/features/auth/lib/next-auth-options.ts
@@ -564,7 +564,7 @@ export const getOptions = ({
if (account.type === "credentials") {
// return token if credentials,saml-idp
if (account.provider === "saml-idp") {
- return token;
+ return { ...token, upId: user.profile?.upId ?? token.upId ?? null } as JWT;
}
// any other credentials, add user info
return {