From 4c5fc6f41ee35973773371494a90cabe084958fb Mon Sep 17 00:00:00 2001 From: Arno V Date: Mon, 24 Jun 2024 23:08:41 +0200 Subject: [PATCH] fix: mark session as expired when JWT does not validate (#26) --- .../src/components/AuthProvider/AuthProvider.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/auth-provider/src/components/AuthProvider/AuthProvider.tsx b/packages/auth-provider/src/components/AuthProvider/AuthProvider.tsx index b577f4a..95bb45b 100644 --- a/packages/auth-provider/src/components/AuthProvider/AuthProvider.tsx +++ b/packages/auth-provider/src/components/AuthProvider/AuthProvider.tsx @@ -48,6 +48,12 @@ export const AuthProvider = ({ logoutReason: "", userId: jwt.payload[JWT.USER_ID_KEY] as string, }); + } else { + setAuthState({ + isAuthenticated: false, + logoutReason: EXPIRED_SESSION, + userId: "", + }); } } catch (_error) { setAuthState({