feat: save user data on successful sign in
This commit is contained in:
parent
591d5734bc
commit
58f0fa0b30
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue