fix(auth): await OAuth storage load() to fix remote OAuth races
This commit is contained in:
parent
7bd26c938e
commit
a24091484c
1 changed files with 245 additions and 133 deletions
|
|
@ -40,8 +40,9 @@ export function useEmaIdpLoginState(
|
|||
|
||||
const logout = useCallback(() => {
|
||||
if (!normalizedIssuer) return;
|
||||
clearEmaIdpSession(storage, normalizedIssuer);
|
||||
setLoginState("none");
|
||||
void clearEmaIdpSession(storage, normalizedIssuer).then(() => {
|
||||
setLoginState("none");
|
||||
});
|
||||
}, [storage, normalizedIssuer]);
|
||||
|
||||
return { loginState, refresh, logout };
|
||||
|
|
|
|||
Loading…
Reference in a new issue