@@ -23,7 +23,7 @@ interface AuthProviderState {
2323}
2424
2525export default function withAuthProvider < T extends React . Component < AuthComponentProps > >
26- ( WrappedComponent : new ( props : AuthComponentProps , context ?: any ) => T ) : React . ComponentClass {
26+ ( WrappedComponent : new ( props : AuthComponentProps , context ?: any ) => T ) : React . ComponentClass {
2727 return class extends React . Component < any , AuthProviderState > {
2828 private userAgentApplication : UserAgentApplication ;
2929
@@ -38,12 +38,12 @@ export default function withAuthProvider<T extends React.Component<AuthComponent
3838 // Initialize the MSAL application object
3939 this . userAgentApplication = new UserAgentApplication ( {
4040 auth : {
41- clientId : config . appId ,
42- redirectUri : config . redirectUri
41+ clientId : config . appId ,
42+ redirectUri : config . redirectUri
4343 } ,
4444 cache : {
45- cacheLocation : "sessionStorage" ,
46- storeAuthStateInCookie : true
45+ cacheLocation : "sessionStorage" ,
46+ storeAuthStateInCookie : true
4747 }
4848 } ) ;
4949 }
@@ -61,28 +61,28 @@ export default function withAuthProvider<T extends React.Component<AuthComponent
6161
6262 render ( ) {
6363 return < WrappedComponent
64- error = { this . state . error }
65- isAuthenticated = { this . state . isAuthenticated }
66- user = { this . state . user }
67- login = { ( ) => this . login ( ) }
68- logout = { ( ) => this . logout ( ) }
69- getAccessToken = { ( scopes : string [ ] ) => this . getAccessToken ( scopes ) }
70- setError = { ( message : string , debug : string ) => this . setErrorMessage ( message , debug ) }
71- { ...this . props } { ... this . state } /> ;
64+ error = { this . state . error }
65+ isAuthenticated = { this . state . isAuthenticated }
66+ user = { this . state . user }
67+ login = { ( ) => this . login ( ) }
68+ logout = { ( ) => this . logout ( ) }
69+ getAccessToken = { ( scopes : string [ ] ) => this . getAccessToken ( scopes ) }
70+ setError = { ( message : string , debug : string ) => this . setErrorMessage ( message , debug ) }
71+ { ...this . props } /> ;
7272 }
7373
7474 async login ( ) {
7575 try {
7676 // Login via popup
7777 await this . userAgentApplication . loginPopup (
78- {
79- scopes : config . scopes ,
80- prompt : "select_account"
78+ {
79+ scopes : config . scopes ,
80+ prompt : "select_account"
8181 } ) ;
8282 // After login, get the user's profile
8383 await this . getUserProfile ( ) ;
8484 }
85- catch ( err ) {
85+ catch ( err ) {
8686 this . setState ( {
8787 isAuthenticated : false ,
8888 user : { } ,
@@ -151,13 +151,13 @@ export default function withAuthProvider<T extends React.Component<AuthComponent
151151
152152 setErrorMessage ( message : string , debug : string ) {
153153 this . setState ( {
154- error : { message : message , debug : debug }
154+ error : { message : message , debug : debug }
155155 } ) ;
156156 }
157157
158158 normalizeError ( error : string | Error ) : any {
159159 var normalizedError = { } ;
160- if ( typeof ( error ) === 'string' ) {
160+ if ( typeof ( error ) === 'string' ) {
161161 var errParts = error . split ( '|' ) ;
162162 normalizedError = errParts . length > 1 ?
163163 { message : errParts [ 1 ] , debug : errParts [ 0 ] } :
0 commit comments