mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Fix user not authenticated interpretation error
This commit is contained in:
@@ -8,6 +8,7 @@ export interface UserProfile {
|
|||||||
photo: string;
|
photo: string;
|
||||||
is_active: boolean;
|
is_active: boolean;
|
||||||
has_documents: boolean;
|
has_documents: boolean;
|
||||||
|
detail: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const userFetcher = () => window.fetch('/api/v1/user').then(res => res.json()).catch(err => console.log(err));
|
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 (error) return null;
|
||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
|
if (data.detail === 'Forbidden') return null;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user