Fixes to other forms and add preview to upload page of icon marketplace
This commit is contained in:
@@ -11,6 +11,9 @@ function LoginForm ({ redirect }: { redirect: string | null }) {
|
||||
const [loading, setLoading] = useState<boolean>(true)
|
||||
const router = useRouter()
|
||||
|
||||
const [username, setUsername] = useState<string>('')
|
||||
const [password, setPassword] = useState<string>('')
|
||||
|
||||
useEffect(() => {
|
||||
document.title = 'Lncvrt Games - Account Login'
|
||||
|
||||
@@ -33,11 +36,6 @@ function LoginForm ({ redirect }: { redirect: string | null }) {
|
||||
onSubmit={async e => {
|
||||
e.preventDefault()
|
||||
|
||||
const form = e.currentTarget
|
||||
const formData = new FormData(form)
|
||||
const username = formData.get('username') as string
|
||||
const password = formData.get('password') as string
|
||||
|
||||
try {
|
||||
const result = await axios.post('/api/account/login', {
|
||||
username,
|
||||
@@ -77,6 +75,8 @@ function LoginForm ({ redirect }: { redirect: string | null }) {
|
||||
name='username'
|
||||
placeholder='Username'
|
||||
type='username'
|
||||
value={username}
|
||||
onChange={e => setUsername(e.target.value)}
|
||||
required
|
||||
/>
|
||||
<input
|
||||
@@ -84,6 +84,8 @@ function LoginForm ({ redirect }: { redirect: string | null }) {
|
||||
name='password'
|
||||
placeholder='Password'
|
||||
type='password'
|
||||
value={password}
|
||||
onChange={e => setPassword(e.target.value)}
|
||||
required
|
||||
/>
|
||||
<button type='submit'>Login</button>
|
||||
|
||||
Reference in New Issue
Block a user