feat: implement authentication flow and session management
- Update RootLayout to handle authentication state and redirect users based on their auth status. - Create an Index component to redirect unauthenticated users to the login page. - Modify ApiAuthRepository to fetch user session data using access and refresh tokens. - Introduce a new container file to manage use case instances for authentication and filament operations. - Enhance authStore to validate tokens and fetch user data from the API. - Add babel-plugin-module-resolver for improved module imports. - Update package.json scripts for running the app on Android and iOS. - Add expo-camera dependency for camera functionalities. - Update tsconfig.json to include infrastructure path mapping.
This commit is contained in:
@@ -9,6 +9,7 @@ import { Header } from '@presentation/components/layout/Header';
|
||||
import { Input } from '@presentation/components/ui/Input';
|
||||
import { Button } from '@presentation/components/ui/Button';
|
||||
import { colors, typography, spacing } from '@shared/theme';
|
||||
import { forgotPasswordUseCase } from '@infrastructure/container';
|
||||
|
||||
const schema = z.object({
|
||||
email: z.string().email('E-mail inválido'),
|
||||
@@ -31,8 +32,7 @@ export default function ForgotPasswordScreen(): React.ReactElement {
|
||||
async function onSubmit(data: FormData): Promise<void> {
|
||||
setIsLoading(true);
|
||||
try {
|
||||
// TODO: ForgotPasswordUseCase
|
||||
console.log('forgot-password', data);
|
||||
await forgotPasswordUseCase.execute(data.email);
|
||||
setSent(true);
|
||||
} catch {
|
||||
Alert.alert('Erro', 'Não foi possível enviar o e-mail.');
|
||||
|
||||
Reference in New Issue
Block a user