Fix auth loop

This commit is contained in:
Michel Roegl-Brunner
2025-11-10 11:57:18 +01:00
parent 8af011a191
commit 86056c984d

View File

@@ -106,7 +106,12 @@ export function AuthProvider({ children }: AuthProviderProps) {
setUsername(data.username);
// Check auth again to get expiration time
await checkAuth();
// Add a small delay to ensure the httpOnly cookie is available
await new Promise<void>((resolve) => {
setTimeout(() => {
void checkAuth().then(() => resolve());
}, 150);
});
return true;
} else {
const errorData = await response.json();