fix: P1-02 OAuth context propagation and P1-16 AuthProvider double-check

P1-02: OAuth ExchangeCode and GetUserInfo now accept context parameter
       to properly propagate request context to HTTP calls
P1-16: AuthProvider isAuthenticated now uses single source of truth
       (effectiveUser !== null) instead of double-checking both
       React state and module-level function
This commit is contained in:
2026-04-18 19:40:54 +08:00
parent e1e423008e
commit 61c19e54ac
5 changed files with 19 additions and 21 deletions

View File

@@ -186,7 +186,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
user: effectiveUser,
roles: effectiveRoles,
isAdmin,
isAuthenticated: effectiveUser !== null && isAuthenticated(),
isAuthenticated: effectiveUser !== null,
isLoading,
onLoginSuccess,
logout,