diff --git a/src/contexts/UserAuthenticationContext.tsx b/src/contexts/UserAuthenticationContext.tsx index 0add797..f873aa0 100644 --- a/src/contexts/UserAuthenticationContext.tsx +++ b/src/contexts/UserAuthenticationContext.tsx @@ -1,15 +1,36 @@ +import type { IuserInformations } from "@/utils/requests/Types"; import { createContext, useContext, useState } from "react"; import type { IauthenticationData } from "./Types"; export interface UserAuthenticationContextProps { isAuthenticated: boolean; setIsAuthenticated: React.Dispatch>; setAuthenticationData: React.Dispatch>; + userInformations: IuserInformations; + setUserInformations: React.Dispatch>; } export const UserAuthenticationContext = createContext({ isAuthenticated: false, setIsAuthenticated: () => {}, setAuthenticationData: () => {}, + userInformations: { + username: "", + email: "", + firstName: "", + lastName: "", + marchand: { + // biome-ignore lint/style/useNamingConvention: + marchand_id: "", + nom: "", + code: "", + adresse: "", + urlSuccess: "", + urlEchec: "", + entreprise: 0, + user: 0, + }, + }, + setUserInformations: () => {}, }); export const UserAuthenticationContextProvider = ({ children }: { children: React.ReactNode }) => { @@ -18,10 +39,33 @@ export const UserAuthenticationContextProvider = ({ children }: { children: Reac access: "", refresh: "", }); + const [userInformations, setUserInformations] = useState({ + username: "", + email: "", + firstName: "", + lastName: "", + marchand: { + // biome-ignore lint/style/useNamingConvention: + marchand_id: "", + nom: "", + code: "", + adresse: "", + urlSuccess: "", + urlEchec: "", + entreprise: 0, + user: 0, + }, + }); return ( {children}