fix(ui): oidc login stuck at loading (#6597)

This commit is contained in:
Chirag Madlani 2022-08-05 12:48:41 +05:30 committed by GitHub
parent 5e1b124d57
commit 4aaa995523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,6 @@ const OidcAuthenticator = forwardRef<AuthenticatorRef, Props>(
const logout = () => {
setLoadingIndicator(true);
setIsAuthenticated(false);
userManager.removeUser();
onLogoutSuccess();
};
@ -110,7 +109,7 @@ const OidcAuthenticator = forwardRef<AuthenticatorRef, Props>(
const AppWithAuth = getAuthenticator(childComponentType, userManager);
return !loading ? (
return (
<>
<Switch>
<Route exact path={ROUTES.HOME}>
@ -140,7 +139,6 @@ const OidcAuthenticator = forwardRef<AuthenticatorRef, Props>(
onLoginSuccess(user as OidcUser);
}}
/>
<Loader />
</>
)}
/>
@ -154,7 +152,6 @@ const OidcAuthenticator = forwardRef<AuthenticatorRef, Props>(
localStorage.setItem(oidcTokenKey, user.id_token);
}}
/>
<Loader />
</>
)}
/>
@ -166,9 +163,8 @@ const OidcAuthenticator = forwardRef<AuthenticatorRef, Props>(
<AppWithAuth />
)}
</Switch>
{loading && <Loader />}
</>
) : (
<Loader />
);
}
);