From 86b6d23f34ee982d1cd1e9ace03d2e016e0b0f61 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Wed, 19 Feb 2025 10:27:55 -0800 Subject: [PATCH] Fix lint issue --- frontend/src/pages/middlewares/authenticate.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/middlewares/authenticate.tsx b/frontend/src/pages/middlewares/authenticate.tsx index 2b1e79a7b..615d03b60 100644 --- a/frontend/src/pages/middlewares/authenticate.tsx +++ b/frontend/src/pages/middlewares/authenticate.tsx @@ -47,12 +47,18 @@ export const Route = createFileRoute("/_authenticate")({ if (err.response?.status === 403) { // (dangtony98): this edge-case can occur if the user's token corresponds to an organization // that has been deleted for which we must clear the refresh token in http-only cookie - clearSession(true); - await logoutUser(); - throw redirect({ - to: "/login" + createNotification({ + type: "error", + title: "Access Denied", + text: "Something went wrong with your session. Please log in again." }); } + clearSession(true); + await logoutUser(); + + throw redirect({ + to: "/login" + }); }); return { organizationId: data.organizationId as string, isAuthenticated: true, user };