This commit is contained in:
2025-02-21 15:25:49 -03:00
parent 142e33726d
commit df82a69af0
7 changed files with 129 additions and 47 deletions

View File

@@ -1,16 +1,23 @@
import type { SubmitHandler } from 'react-hook-form'
import type { AuthContextType } from '~/hooks/use-auth'
import { useForm } from 'react-hook-form'
import { useAuth } from '~/hooks/use-auth'
import { Card } from '~/layouts/auth'
import { Control, Label, Input, Button } from '~/components/form'
import { useNavigate } from 'react-router'
type Input = {
username: string
password: string
}
export default function Signin() {
const navigate = useNavigate()
const { register, handleSubmit, formState } = useForm()
const { register, handleSubmit, formState } = useForm<Input>()
const { signIn } = useAuth()
const onSubmit = async (payload) => {
const { nextStep } = await signIn(payload)
const onSubmit: SubmitHandler<Input> = async (data) => {
const { nextStep } = await signIn(data)
return navigate('/')
}