fix: registration — parse AuthResponse correctly, auto-login after successful registration
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m38s
test / unit (pull_request) Successful in 16m14s
test / integration (pull_request) Failing after 17m16s
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m38s
test / unit (pull_request) Successful in 16m14s
test / integration (pull_request) Failing after 17m16s
This commit is contained in:
@@ -168,7 +168,11 @@ async function apiFetch<T>(
|
||||
// ── Auth ──────────────────────────────────────────────────────────────────
|
||||
|
||||
export const registerUser = (data: z.infer<typeof RegisterSchema>) =>
|
||||
apiFetch("/auth/register", { method: "POST", body: JSON.stringify(data) }, UserSchema);
|
||||
apiFetch(
|
||||
"/auth/register",
|
||||
{ method: "POST", body: JSON.stringify(data) },
|
||||
z.object({ token: z.string(), user: UserSchema })
|
||||
);
|
||||
|
||||
export const loginUser = (data: z.infer<typeof LoginSchema>) =>
|
||||
apiFetch("/auth/login", { method: "POST", body: JSON.stringify(data) }, z.object({ token: z.string() }));
|
||||
|
||||
Reference in New Issue
Block a user