mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Fix user not authenticated interpretation error
This commit is contained in:
parent
24a0d8b073
commit
80fe5ce182
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue