diff options
Diffstat (limited to 'src/app/context/auth.tsx')
| -rw-r--r-- | src/app/context/auth.tsx | 9 |
1 files changed, 8 insertions, 1 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); }, |
