Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
EVG-21018 Catch logout errors (#2082)
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 authored Oct 4, 2023
1 parent 4e0b778 commit 9b09e06
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/context/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
credentials: "include",
method: "GET",
redirect: "manual",
}).then(() => {
dispatch({ type: "deauthenticated" });
window.location.href = `${getLoginDomain()}/login`;
});
})
.then(() => {
dispatch({ type: "deauthenticated" });
window.location.href = `${getLoginDomain()}/login`;
})
.catch((error) => {
leaveBreadcrumb("Logout failed", { error }, "user");
});
},
dispatchAuthenticated: () => {
if (!state.isAuthenticated) {
Expand Down

0 comments on commit 9b09e06

Please sign in to comment.