From de4ab0c5c281825aebc31c1bc48e84750886f6f3 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 11 Jun 2026 23:37:06 -0700 Subject: fix: auth registration username not being written --- src/app/context/auth.tsx | 9 ++++++++- src/app/signin/page.tsx | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/context/auth.tsx b/src/app/context/auth.tsx index f7e7cc2..934198e 100644 --- a/src/app/context/auth.tsx +++ b/src/app/context/auth.tsx @@ -45,7 +45,14 @@ export function AuthProvider({ children }: { children: React.ReactNode }) { const signUp = useCallback( async (email: string, username: string, password: string, passwordConfirm: string) => { - await pb.collection("users").create({ email, username, password, passwordConfirm }); + const normalizedUsername = username.trim(); + await pb.collection("users").create({ + email, + username: normalizedUsername, + name: normalizedUsername, + password, + passwordConfirm, + }); await pb.collection("users").authWithPassword(email, password); setUser(pb.authStore.record ?? null); }, diff --git a/src/app/signin/page.tsx b/src/app/signin/page.tsx index 67a4fd3..06d1510 100644 --- a/src/app/signin/page.tsx +++ b/src/app/signin/page.tsx @@ -230,7 +230,7 @@ export default function SignInPage() { setUsername(e.target.value)} required -- cgit v1.2.3