Fixes to other forms and add preview to upload page of icon marketplace

This commit is contained in:
2026-01-31 01:53:29 -07:00
parent e6daa2e36c
commit 85a5e45b27
5 changed files with 70 additions and 28 deletions

View File

@@ -11,6 +11,9 @@ function ResetPasswordForm ({ codeParam }: { codeParam: string }) {
const [token, setToken] = useState<string | null>(null)
const [result, setResult] = useState<number>(-1)
const [newPassword, setNewPassword] = useState<string>('')
const [retypeNewPassword, setRetypeNewPassword] = useState<string>('')
useEffect(() => {
document.title = 'Lncvrt Games - Reset Account Password'
}, [])
@@ -40,12 +43,7 @@ function ResetPasswordForm ({ codeParam }: { codeParam: string }) {
onSubmit={async e => {
e.preventDefault()
const form = e.currentTarget
const formData = new FormData(form)
const password = formData.get('new-password') as string
const confirm = formData.get('retype-password') as string
if (password !== confirm) {
if (newPassword !== retypeNewPassword) {
alert('Passwords must match')
return
}
@@ -54,7 +52,7 @@ function ResetPasswordForm ({ codeParam }: { codeParam: string }) {
const result = await axios.post('/api/account/reset-password', {
token,
code: codeParam,
password
password: newPassword
})
if (result.data.success) {
setResult(2)
@@ -85,14 +83,18 @@ function ResetPasswordForm ({ codeParam }: { codeParam: string }) {
placeholder='New password'
type='password'
autoComplete='new-password'
value={newPassword}
onChange={e => setNewPassword(e.target.value)}
required
/>
<input
id='retype-password'
name='retype-password'
id='retype-new-password'
name='retype-new-password'
placeholder='Re-type password'
type='password'
autoComplete='new-password'
value={retypeNewPassword}
onChange={e => setRetypeNewPassword(e.target.value)}
required
/>
<button type='submit'>Update password</button>