Skip to content

Commit

Permalink
fix: fix recover password
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheusafonsouza committed Dec 9, 2024
1 parent 42e897d commit 68faf06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useApi/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const useApi = () => {
recoverPassword: (email: string): Promise<{ data: any }> => {
return new Promise((resolve) => {
api
.post(`/auth/recover-password/${email}`)
.post(`/auth/recover-password`, { email })
.then((res) => resolve(res))
.catch((err) => resolve(getDefaultErrorUseAPIMessage(err)));
});
Expand Down
12 changes: 10 additions & 2 deletions src/pages/SignIn/SignInForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react';
import { useAuth } from '../../../hooks/useAuth';
import { useNavigate } from 'react-router';
import { Input, Stack } from '@chakra-ui/react';
import { Link, useNavigate } from 'react-router';
import { Input, Stack, Link as ChakraLink, Text } from '@chakra-ui/react';
import { useForm } from 'react-hook-form';
import { PasswordInput } from '../../../components/ui/password-input';
import { Button } from '../../../components/ui/button';
Expand Down Expand Up @@ -62,6 +62,14 @@ function SignInForm() {
{...register('password', { required: "Campo obrigatório." })}
/>
</Field>
<Stack gap={'25px'} width={'100%'}>
<Text
textAlign={'center'}
color={'blue.100'}
>
Não lembra sua senha? <ChakraLink color={'green.100'}><Link to='/recuperar-senha'>Recupere ela aqui</Link></ChakraLink>
</Text>
</Stack>
</Stack>
<Button
loading={loading}
Expand Down

0 comments on commit 68faf06

Please sign in to comment.