From 80fe5ce182ebed7adbde12b0c59c3916fbc1a265 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 27 Jun 2024 21:13:54 +0530 Subject: [PATCH] Fix user not authenticated interpretation error --- src/interface/web/app/common/auth.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/interface/web/app/common/auth.ts b/src/interface/web/app/common/auth.ts index 45ac540b..27a0a224 100644 --- a/src/interface/web/app/common/auth.ts +++ b/src/interface/web/app/common/auth.ts @@ -8,6 +8,7 @@ export interface UserProfile { photo: string; is_active: boolean; has_documents: boolean; + detail: string; } const userFetcher = () => window.fetch('/api/v1/user').then(res => res.json()).catch(err => console.log(err)); @@ -18,6 +19,7 @@ export function useAuthenticatedData() { if (error) return null; if (!data) return null; + if (data.detail === 'Forbidden') return null; return data; }