fix: call fetchMe after token acquire regardless of loading state

loading starts as true in the store, so the previous condition
`!user && !loading` prevented fetchMe from ever being called after
the Azure AD redirect — causing a permanent Loading spinner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-03-23 14:46:43 +00:00
parent 08710e1a16
commit 0b2b61ee2d

View file

@ -38,7 +38,7 @@ function AuthGate({ children }: { children: React.ReactNode }) {
scopes: ['openid', 'profile', 'email'],
})
setToken(result.idToken)
if (!user && !loading) fetchMe()
if (!user) fetchMe()
} catch {
instance.loginRedirect({ scopes: ['openid', 'profile', 'email'] })
}