session and auth fix

This commit is contained in:
Mateusz Gruszczyński
2026-07-26 15:59:23 +02:00
parent 9a95119b06
commit f145c3c121
6 changed files with 106 additions and 12 deletions
+3 -1
View File
@@ -278,7 +278,9 @@ export async function validateCurrentSession() {
const token = getAuthToken();
if (!token) return null;
try {
return await api("/api/auth/me", { headers: { Authorization: `Bearer ${token}` } });
const session = await api("/api/auth/me", { headers: { Authorization: `Bearer ${token}` } });
setAuthSession(session);
return session;
} catch {
clearAuthSession();
return null;