Fix auth throttling causing login loops by adding forced session checks
All checks were successful
Build And Push Image / docker (push) Successful in 3m27s

Add optional force parameter to checkAuth() to bypass throttling during
critical authentication flows like login, middleware, and initial auth
verification. This prevents iOS Safari login loops while maintaining
throttling for regular session checks.
This commit is contained in:
2025-08-07 17:01:01 +02:00
parent 2843bcf4f5
commit 616490dfef
4 changed files with 147 additions and 10 deletions

View File

@@ -132,7 +132,9 @@ const { user, login, loading: authLoading, error: authError, checkAuth } = useAu
const { isMobileDevice, debugMobileLogin, runMobileDiagnostics } = await import('~/utils/mobile-utils');
// Check if user is already authenticated - prevent iOS Safari loops
if (user.value) {
// Use forced check to ensure we get accurate authentication status
const isAlreadyAuthenticated = await checkAuth(true);
if (isAlreadyAuthenticated && user.value) {
const redirectUrl = '/dashboard';
// Always use window.location for iOS Safari to prevent loops