aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app/context/auth.tsx9
-rw-r--r--src/app/signin/page.tsx2
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() {
<Input
id="auth-username"
type="text"
- placeholder="your username"
+ placeholder="Your Username"
value={username}
onChange={(e) => setUsername(e.target.value)}
required
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage