Skip to content

Commit f8e0894

Browse files
nimra06cursoragent
authored andcommitted
Fix stale logged-in UI when auth verify fails on network error.
Clear stored auth when /auth/verify cannot complete, matching 401/422 behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fca5d81 commit f8e0894

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎frontend/js/app.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,8 @@ async function verifyStoredAuthSession() {
324324
}
325325

326326
const response = await fetch(`${MOOD_API_BASE}/auth/verify`, {
327-
credentials: 'include',
328-
headers,
329327
method: 'GET',
328+
headers,
330329
credentials: 'include',
331330
});
332331

@@ -345,8 +344,9 @@ async function verifyStoredAuthSession() {
345344
}
346345
return null;
347346
} catch (error) {
348-
console.warn('Auth verification failed; using cached session state if available.', error);
349-
return storedUser;
347+
console.warn('Auth verification could not reach the server; clearing local session.', error);
348+
clearStoredAuthState();
349+
return null;
350350
}
351351
})();
352352

0 commit comments

Comments
 (0)