From a6bd3395344c6a61764fadb184385e4e372d33ec Mon Sep 17 00:00:00 2001 From: Ganesh Karande Date: Sun, 28 Sep 2025 14:36:38 +0530 Subject: [PATCH] upadted the logout-auto-login session 769 --- packages/app/src/app/api/auth/[...nextauth]/route.ts | 8 ++++++++ packages/app/src/components/ui/buttons.tsx | 2 ++ 2 files changed, 10 insertions(+) diff --git a/packages/app/src/app/api/auth/[...nextauth]/route.ts b/packages/app/src/app/api/auth/[...nextauth]/route.ts index d9a9c3ac..6ae0cfdf 100644 --- a/packages/app/src/app/api/auth/[...nextauth]/route.ts +++ b/packages/app/src/app/api/auth/[...nextauth]/route.ts @@ -25,6 +25,14 @@ export const nextAuthOptions = { GithubProvider({ clientId: env.GITHUB_CLIENT_ID, clientSecret: env.GITHUB_CLIENT_SECRET, + authorization: { + params: { + // Request standard scopes explicitly and attempt to force a fresh login + scope: "read:user user:email", + // Some providers respect prompt=login; GitHub may ignore it, but harmless + prompt: "login", + }, + }, }), ], callbacks: { diff --git a/packages/app/src/components/ui/buttons.tsx b/packages/app/src/components/ui/buttons.tsx index acb0d6b1..d7322ccb 100644 --- a/packages/app/src/components/ui/buttons.tsx +++ b/packages/app/src/components/ui/buttons.tsx @@ -13,6 +13,8 @@ export const LoginButton = () => { onClick={() => signIn("github", { callbackUrl: `${location.origin}/race`, + // Attempt to force a fresh login at the provider + prompt: "login", }) } >