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

@@ -7,9 +7,9 @@ export default defineNuxtRouteMiddleware(async (to) => {
// Use the same auth system as the rest of the app
const { isAuthenticated, checkAuth, user } = useAuth();
// Ensure auth is checked if user isn't loaded
// Ensure auth is checked if user isn't loaded - use forced check for middleware
if (!user.value) {
await checkAuth();
await checkAuth(true); // Force check to bypass throttling in middleware
}
if (!isAuthenticated.value) {