aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/stores/auth.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/stores/auth.tsx')
-rw-r--r--src/client/stores/auth.tsx13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/client/stores/auth.tsx b/src/client/stores/auth.tsx
index cca314a..58e9d40 100644
--- a/src/client/stores/auth.tsx
+++ b/src/client/stores/auth.tsx
@@ -18,7 +18,6 @@ export interface AuthState {
export interface AuthActions {
login: (username: string, password: string) => Promise<void>;
- register: (username: string, password: string) => Promise<void>;
logout: () => void;
}
@@ -52,15 +51,6 @@ export function AuthProvider({ children }: AuthProviderProps) {
setUser(response.user);
}, []);
- const register = useCallback(
- async (username: string, password: string) => {
- await apiClient.register(username, password);
- // After registration, log in automatically
- await login(username, password);
- },
- [login],
- );
-
const logout = useCallback(() => {
apiClient.logout();
setUser(null);
@@ -74,10 +64,9 @@ export function AuthProvider({ children }: AuthProviderProps) {
isAuthenticated,
isLoading,
login,
- register,
logout,
}),
- [user, isAuthenticated, isLoading, login, register, logout],
+ [user, isAuthenticated, isLoading, login, logout],
);
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;