diff --git a/src/router/auth.tsx b/src/router/auth.tsx index a06afa1..917b687 100644 --- a/src/router/auth.tsx +++ b/src/router/auth.tsx @@ -136,6 +136,7 @@ export const useProvideAuth = (): AuthStateContext => { }; const signout = () => { + window.location.href = ROUTE_LOGIN; return new Promise((resolve, reject) => { postLogout() .then((response) => { @@ -143,7 +144,6 @@ export const useProvideAuth = (): AuthStateContext => { localStorage.clear(); sessionStorage.clear(); sessionStorage.setItem(SESS_FLASH_MSG, MSG_LOGGED_OUT); - window.location.href = ROUTE_LOGIN; resolve(response.json); } }) @@ -151,7 +151,6 @@ export const useProvideAuth = (): AuthStateContext => { localStorage.clear(); sessionStorage.clear(); sessionStorage.setItem(SESS_FLASH_MSG, MSG_LOGGED_OUT); - window.location.href = ROUTE_LOGIN; if (error) { reject(error); }