fix: Await auth delete request before forwarding to OIDC

This commit is contained in:
Tom Moor
2024-04-02 21:57:20 -04:00
parent 40cf70d7ca
commit e0ae044f4c
2 changed files with 11 additions and 10 deletions

View File

@@ -5,11 +5,13 @@ import useStores from "~/hooks/useStores";
const Logout = () => {
const { auth } = useStores();
void auth.logout();
if (env.OIDC_LOGOUT_URI) {
window.location.replace(env.OIDC_LOGOUT_URI);
return null;
}
void auth.logout().then(() => {
if (env.OIDC_LOGOUT_URI) {
window.location.replace(env.OIDC_LOGOUT_URI);
}
});
return <Redirect to="/" />;
};