File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
front/src/contexts/auth/context Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 1- // @flow
2-
3- // #region imports
41import { createContext } from 'react' ;
5- // #endregion
62
73// #region flow types
84export type User = {
9- email : string ,
5+ email : string ;
106} ;
117
128export type AuthData = {
13- isAuthenticated : boolean ,
14- isExpiredToken : boolean ,
15- lastAuthDate ?: Date ,
16-
17- token : string ,
18- user : User ,
19- ...any ,
9+ isAuthenticated : boolean ;
10+ isExpiredToken ?: boolean ;
11+ lastAuthDate ?: Date ;
12+ token ?: string ;
13+ user ?: User ;
2014} ;
2115// #endregion
2216
2317// #region default context value
24- export const authDefault = {
18+ export const authDefault : AuthData = {
2519 isAuthenticated : false ,
26- lastAuthDate : null ,
2720} ;
2821// #endregion
2922
3023// #region context
31- const AuthContext = createContext ( {
24+ const AuthContext = createContext < AuthData > ( {
3225 ...authDefault ,
3326} ) ;
3427
You can’t perform that action at this time.
0 commit comments