diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index b269b159..ca23daef 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -137,9 +137,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ try { const userProfile = await aethexUserService.getCurrentUser(); setProfile(userProfile); + setLoading(false); return userProfile; } catch (error) { console.error("Error fetching user profile:", error); + setLoading(false); return null; } };