File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { createContext } from 'react' ;
2
2
3
3
// #region types
4
- export type User = {
5
- email : string ;
6
- } ;
7
4
8
5
export type AuthData = {
9
6
isAuthenticated : boolean ;
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
- import { AuthContextProvider , AuthData , User } from '../context' ;
2
+ import { AuthContextProvider , AuthData } from '../context' ;
3
3
import auth from '../../../services/auth' ;
4
4
import { devToolsStore } from '../../withDevTools' ;
5
5
@@ -68,7 +68,7 @@ export default class AuthProvider extends Component<
68
68
// #endregion
69
69
70
70
checkIsAuthenticated = ( ) : boolean => {
71
- const checkUserHasId = ( user : User ) => user && user ?. id ;
71
+ const checkUserHasId = ( user : User ) => user ?. id ?? '' ;
72
72
const user = auth . getUserInfo ( ) ? auth . getUserInfo ( ) : null ;
73
73
const isAuthenticated = auth . getToken ( ) && checkUserHasId ( user ) ;
74
74
Original file line number Diff line number Diff line change 117
117
"modernizr-webpack-plugin" : " ^1.0.7" ,
118
118
"nodemon" : " ^1.17.3" ,
119
119
"optimize-css-assets-webpack-plugin" : " ^4.0.1" ,
120
+ "prettier" : " ^1.19.1" ,
120
121
"progress-bar-webpack-plugin" : " ^1.11.0" ,
121
122
"react-hot-loader" : " ^4.12.15" ,
122
123
"react-snap" : " ^1.20.0" ,
123
124
"rimraf" : " ^2.6.2" ,
124
125
"sass-loader" : " ^7.0.1" ,
125
126
"sinon" : " ^2.3.1" ,
126
127
"style-loader" : " ^0.21.0" ,
128
+ "typescript" : " ^3.7.2" ,
127
129
"url-loader" : " ^1.0.1" ,
128
130
"webpack" : " ^4.6.0" ,
129
131
"webpack-bundle-analyzer" : " ^2.11.1" ,
Original file line number Diff line number Diff line change @@ -9671,6 +9671,11 @@ prettier-eslint@^8.8.2:
9671
9671
typescript-eslint-parser "^16.0.0"
9672
9672
vue-eslint-parser "^2.0.2"
9673
9673
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
+
9674
9679
prettier@^1.5.3, prettier@^1.7.0:
9675
9680
version "1.12.1"
9676
9681
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"
@@ -12082,6 +12087,11 @@ typescript@^2.5.1:
12082
12087
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
12083
12088
integrity sha512-K7g15Bb6Ra4lKf7Iq2l/I5/En+hLIHmxWZGq3D4DIRNFxMNV6j2SHSvDOqs2tGd4UvD/fJvrwopzQXjLrT7Itw==
12084
12089
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
+
12085
12095
ua-parser-js@^0.7.9:
12086
12096
version "0.7.18"
12087
12097
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"
You can’t perform that action at this time.
0 commit comments