feat: complete user authentication with separate login and register pages

This commit is contained in:
Marko (Hermes Implementer)
2026-05-26 04:35:27 +00:00
parent 6867a91b67
commit fc0531395d
6 changed files with 254 additions and 5 deletions
+4 -2
View File
@@ -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