This commit is contained in:
2025-02-22 09:52:00 -03:00
parent 7b51166db8
commit bc77e892a5
11 changed files with 375 additions and 32 deletions

View File

@@ -16,6 +16,7 @@ import { Heading } from '~/components/heading'
import { Link } from '~/layouts/auth/_link'
import { Card } from '~/layouts/auth/layout'
import * as yup from 'yup'
import { parse } from '../_base64state'
const schema = yup.object({
password: yup
@@ -33,6 +34,7 @@ export default function Password() {
const { register, formState, setError, handleSubmit } = useForm({
resolver: yupResolver(schema),
})
const state = parse(searchParams.get('state'))
const formError = (message) => {
setError('password', {
@@ -42,7 +44,7 @@ export default function Password() {
}
const onSubmit = async ({ password }) => {
const username = searchParams.get('username')
const username = state?.email
const redirectTo = searchParams.get('redirect') ?? '/'
try {
@@ -114,9 +116,7 @@ export default function Password() {
<p className="break-all">
Entre na sua conta usando o email{' '}
<span className="font-semibold">
{searchParams.get('username')}
</span>{' '}
<span className="font-semibold">{state?.email}</span>{' '}
<Link to="." as={RouterLink}>
(editar)
</Link>