remember added
This commit is contained in:
@@ -29,12 +29,14 @@ const fields: AuthFormField[] = [{
|
||||
|
||||
const schema = z.object({
|
||||
email: z.email('Invalid email'),
|
||||
password: z.string('Password is required').min(8, 'Must be at least 8 characters')
|
||||
password: z.string('Password is required').min(8, 'Must be at least 8 characters'),
|
||||
remember: z.boolean().optional()
|
||||
})
|
||||
|
||||
type Schema = z.output<typeof schema>
|
||||
|
||||
function onSubmit(payload: FormSubmitEvent<Schema>) {
|
||||
console.log(payload.data)
|
||||
return fetch("/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
@@ -42,7 +44,8 @@ function onSubmit(payload: FormSubmitEvent<Schema>) {
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email: payload.data.email,
|
||||
password: payload.data.password
|
||||
password: payload.data.password,
|
||||
remember: payload.data.remember || false
|
||||
})
|
||||
}).then((response) => {
|
||||
if (response.ok)
|
||||
|
||||
Reference in New Issue
Block a user