login without distant server local only mode

This commit is contained in:
m
2026-09-10 21:56:34 +02:00
parent cac2400917
commit 4e2d92a80e
6 changed files with 37 additions and 7 deletions
+6 -2
View File
@@ -87,9 +87,13 @@ export function AuthProvider({ children }: { children: ReactNode }) {
setStatus('signedIn');
};
const continueWithoutAccount = () => {
setStatus('local');
};
const value = useMemo(
() => ({ user, deviceUserId, status, signIn, signOut }),
[user, deviceUserId, status, signIn, signOut],
() => ({ user, deviceUserId, status, signIn, signOut, continueWithoutAccount }),
[user, deviceUserId, status, signIn, signOut, continueWithoutAccount],
);
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
+2 -1
View File
@@ -2,7 +2,7 @@ import type { User } from '../api/types';
export type { User };
export type AuthStatus = 'loading' | 'signedOut' | 'signedIn';
export type AuthStatus = 'loading' | 'signedOut' | 'local' | 'signedIn';
export type AuthContextValue = {
user: User | null;
@@ -10,4 +10,5 @@ export type AuthContextValue = {
status: AuthStatus;
signIn: (username: string, password: string) => Promise<void>;
signOut: () => Promise<void>;
continueWithoutAccount: () => void;
};