From 9b09e0609384d0a039165966bf933c92df5c8a60 Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Wed, 4 Oct 2023 17:23:28 -0400 Subject: [PATCH] EVG-21018 Catch logout errors (#2082) --- src/context/auth.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/context/auth.tsx b/src/context/auth.tsx index 13f4fb4116..8d704d3637 100644 --- a/src/context/auth.tsx +++ b/src/context/auth.tsx @@ -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) {