feat: do not login loop if disable_api_key_login is true

This commit is contained in:
Aarnav Tale 2025-04-03 12:25:15 -04:00
parent cf90f3dd32
commit 9b09b13b5f
No known key found for this signature in database
2 changed files with 56 additions and 13 deletions

View file

@ -14,7 +14,13 @@ export async function action({
return redirect('/login');
}
return redirect('/login', {
// When API key is disabled, we need to explicitly redirect
// with a logout state to prevent auto login again.
const url = context.config.oidc?.disable_api_key_login
? '/login?s=logout'
: '/login';
return redirect(url, {
headers: {
'Set-Cookie': await context.sessions.destroy(session),
},