fix SSO
This commit is contained in:
+12
@@ -20,6 +20,18 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
clientSecret: process.env.AUTH_MICROSOFT_ENTRA_ID_SECRET,
|
||||
// Tenant-specific issuer restricts sign-in to our organization only.
|
||||
issuer: process.env.AUTH_MICROSOFT_ENTRA_ID_ISSUER,
|
||||
// The provider's default profile() pulls the Graph photo and inlines it as a
|
||||
// base64 data-URI into user.image -> the `picture` JWT claim. Since sessions
|
||||
// are JWTs, that becomes a multi-KB chunked session cookie whose combined
|
||||
// Cookie header overflows nginx's proxy buffer -> 502 before the request ever
|
||||
// reaches this app. We never render an avatar, so keep the token lean.
|
||||
authorization: { params: { scope: "openid profile email" } },
|
||||
profile: (profile) => ({
|
||||
id: profile.sub,
|
||||
name: profile.name,
|
||||
email: profile.email,
|
||||
image: null,
|
||||
}),
|
||||
}),
|
||||
Credentials({
|
||||
name: "Local account",
|
||||
|
||||
Reference in New Issue
Block a user