mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-07-24 13:02:21 +00:00
logout with one click (#223)
Co-authored-by: eglehelms <e.helms@cognigy.com>
This commit is contained in:
+1
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user