Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6cb2434

Browse files
committed
add username input
1 parentaee2e65 commit6cb2434

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

‎components/SignUpForm.tsx‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function SignUpForm({
2222
...props
2323
}:React.ComponentPropsWithoutRef<'div'>){
2424
const[email,setEmail]=useState('')
25+
const[username,setUsername]=useState('')
2526
const[password,setPassword]=useState('')
2627
const[repeatPassword,setRepeatPassword]=useState('')
2728
const[error,setError]=useState<string|null>(null)
@@ -45,7 +46,10 @@ export function SignUpForm({
4546
email,
4647
password,
4748
options:{
48-
emailRedirectTo:`${window.location.origin}/dashboard`,
49+
emailRedirectTo:`${window.location.origin}/auth/callback`,
50+
data:{
51+
username:username.trim(),
52+
},
4953
},
5054
})
5155
if(error)throwerror
@@ -78,6 +82,20 @@ export function SignUpForm({
7882
onChange={(e)=>setEmail(e.target.value)}
7983
/>
8084
</div>
85+
<divclassName="grid gap-2">
86+
<LabelhtmlFor="username">Username</Label>
87+
<Input
88+
id="username"
89+
type="text"
90+
placeholder="Your username"
91+
required
92+
value={username}
93+
onChange={(e)=>setUsername(e.target.value)}
94+
minLength={3}
95+
pattern="^[a-zA-Z0-9_]+$"
96+
title="Username can only contain letters, numbers, and underscores."
97+
/>
98+
</div>
8199
<divclassName="grid gap-2">
82100
<divclassName="flex items-center">
83101
<LabelhtmlFor="password">Password</Label>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp