Skip to content

Commit 3e6b0ca

Browse files
committed
migration
1 parent fff4a49 commit 3e6b0ca

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

front/src/contexts/auth/context/index.js renamed to front/src/contexts/auth/context/index.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
// @flow
2-
3-
// #region imports
41
import { createContext } from 'react';
5-
// #endregion
62

73
// #region flow types
84
export type User = {
9-
email: string,
5+
email: string;
106
};
117

128
export 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

0 commit comments

Comments
 (0)