feat: save user data on successful sign in

This commit is contained in:
Vinicius Souza 2024-10-31 09:26:36 -03:00
parent 591d5734bc
commit 58f0fa0b30

View file

@ -2,6 +2,7 @@ import { createContext, useState } from 'react';
import { UserDTO } from '@dtos/UserDTO';
import { api } from '@services/api';
import { storageUserSave } from '@storage/storageUser';
type AuthContextData = {
user: UserDTO;
@ -23,6 +24,7 @@ export function AuthContextProvider({ children }: AuthContextProviderProps) {
if (data.user) {
setUser(data.user);
storageUserSave(data.user);
}
} catch (error) {
console.error(error);