Skip to content

Commit 2e0869b

Browse files
committed
migration
1 parent 1160a36 commit 2e0869b

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

front/src/contexts/auth/context/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { createContext } from 'react';
22

33
// #region types
4-
export type User = {
5-
email: string;
6-
};
74

85
export type AuthData = {
96
isAuthenticated: boolean;

front/src/contexts/auth/providerComponent/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { AuthContextProvider, AuthData, User } from '../context';
2+
import { AuthContextProvider, AuthData } from '../context';
33
import auth from '../../../services/auth';
44
import { devToolsStore } from '../../withDevTools';
55

@@ -68,7 +68,7 @@ export default class AuthProvider extends Component<
6868
// #endregion
6969

7070
checkIsAuthenticated = (): boolean => {
71-
const checkUserHasId = (user: User) => user && user?.id;
71+
const checkUserHasId = (user: User) => user?.id ?? '';
7272
const user = auth.getUserInfo() ? auth.getUserInfo() : null;
7373
const isAuthenticated = auth.getToken() && checkUserHasId(user);
7474

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@
117117
"modernizr-webpack-plugin": "^1.0.7",
118118
"nodemon": "^1.17.3",
119119
"optimize-css-assets-webpack-plugin": "^4.0.1",
120+
"prettier": "^1.19.1",
120121
"progress-bar-webpack-plugin": "^1.11.0",
121122
"react-hot-loader": "^4.12.15",
122123
"react-snap": "^1.20.0",
123124
"rimraf": "^2.6.2",
124125
"sass-loader": "^7.0.1",
125126
"sinon": "^2.3.1",
126127
"style-loader": "^0.21.0",
128+
"typescript": "^3.7.2",
127129
"url-loader": "^1.0.1",
128130
"webpack": "^4.6.0",
129131
"webpack-bundle-analyzer": "^2.11.1",

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9671,6 +9671,11 @@ prettier-eslint@^8.8.2:
96719671
typescript-eslint-parser "^16.0.0"
96729672
vue-eslint-parser "^2.0.2"
96739673

9674+
prettier@^1.19.1:
9675+
version "1.19.1"
9676+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
9677+
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
9678+
96749679
prettier@^1.5.3, prettier@^1.7.0:
96759680
version "1.12.1"
96769681
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
@@ -12082,6 +12087,11 @@ typescript@^2.5.1:
1208212087
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
1208312088
integrity sha512-K7g15Bb6Ra4lKf7Iq2l/I5/En+hLIHmxWZGq3D4DIRNFxMNV6j2SHSvDOqs2tGd4UvD/fJvrwopzQXjLrT7Itw==
1208412089

12090+
typescript@^3.7.2:
12091+
version "3.7.2"
12092+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb"
12093+
integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ==
12094+
1208512095
ua-parser-js@^0.7.9:
1208612096
version "0.7.18"
1208712097
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"

0 commit comments

Comments
 (0)