mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-10 20:35:17 +02:00
fix: always init Zero when user exists, pass auth as optional
This commit is contained in:
parent
5c98f1c717
commit
54ffdc5aad
1 changed files with 2 additions and 3 deletions
|
|
@ -42,15 +42,14 @@ function ZeroAuthGuard({ children }: { children: React.ReactNode }) {
|
|||
|
||||
export function ZeroProvider({ children }: { children: React.ReactNode }) {
|
||||
const { data: user } = useAtomValue(currentUserAtom);
|
||||
const token = getBearerToken();
|
||||
|
||||
if (!user?.id || !token) {
|
||||
if (!user?.id) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
const userID = String(user.id);
|
||||
const context = { userId: userID };
|
||||
const auth = token;
|
||||
const auth = getBearerToken() || undefined;
|
||||
|
||||
return (
|
||||
<ZeroReactProvider {...{ userID, context, cacheURL, schema, queries, auth }}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue