diff --git a/server/api/auth/keycloak/callback.ts b/server/api/auth/keycloak/callback.ts index 5f57050..bad4a64 100644 --- a/server/api/auth/keycloak/callback.ts +++ b/server/api/auth/keycloak/callback.ts @@ -100,8 +100,61 @@ export default defineEventHandler(async (event) => { console.log(`[KEYCLOAK] Authentication completed successfully in ${totalDuration}ms`) console.log('[KEYCLOAK] Session cookie set, redirecting to dashboard...') - // Redirect to dashboard - await sendRedirect(event, '/dashboard') + // Return HTML with client-side redirect for SPA compatibility + setHeader(event, 'Content-Type', 'text/html') + return ` + + +
+Redirecting to dashboard...
+If you are not redirected automatically, click here.
+