This commit is contained in:
2025-11-12 03:20:01 +05:30
parent eddb251e4d
commit e9c654e138
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
setError(null);
const res = await api.post('/auth/register', { username, password });
return res.data; // returns PublicUser from backend
return res.data; // returns PublicUser from the backend
} catch (err: any) {
console.error('Registration failed:', err);
setError(err.response?.data?.detail || 'Registration failed');
@@ -109,7 +109,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
setCurrentUser(fullUser);
} catch (err) {
console.error('Failed to fetch current user:', err);
logout(); // invalid/expired token
logout();
}
};