feat: complete user authentication with separate login and register pages
This commit is contained in:
@@ -98,8 +98,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const register = useCallback(async (payload: RegisterPayload) => {
|
||||
dispatch({ type: "AUTH_START" });
|
||||
try {
|
||||
const user = await registerUser(payload);
|
||||
dispatch({ type: "AUTH_SUCCESS", payload: user });
|
||||
await registerUser(payload);
|
||||
// Registration succeeded — the page component handles redirect to /login.
|
||||
// Set isLoading=false by clearing auth state (no auto-authentication).
|
||||
dispatch({ type: "LOGOUT" });
|
||||
} catch (err: unknown) {
|
||||
const message =
|
||||
err instanceof Error
|
||||
|
||||
Reference in New Issue
Block a user