File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -515,7 +515,31 @@ const authSetup = function () {
515515 if ( token && ! isTokenExpired ( token ) ) {
516516 informIt ( success ) ;
517517 } else if ( ! token ) {
518- informIt ( failed ) ;
518+ const auth0Session = getCookie ( 'auth0.is.authenticated' ) ;
519+ logger ( 'auth0 session available ?' , auth0Session ) ;
520+ if ( auth0Session ) {
521+ logger ( 'auth session true' , 1 ) ;
522+ if ( ! auth0 ) {
523+ createAuth0Client ( {
524+ domain : domain ,
525+ client_id : clientId ,
526+ cacheLocation : useLocalStorage
527+ ? 'localstorage'
528+ : 'memory' ,
529+ useRefreshTokens : useRefreshTokens
530+ } ) . then ( function ( newAuth0Obj ) {
531+ getToken ( newAuth0Obj ) ;
532+ } ) . catch ( function ( e ) {
533+ logger ( "Error occurred in re-initializing auth0 object: " , e ) ;
534+ informIt ( failed ) ;
535+ } ) ;
536+ } else {
537+ getToken ( auth0 ) ;
538+ }
539+ } else {
540+ informIt ( failed ) ;
541+ }
542+
519543 } else {
520544 if ( auth0 ) {
521545 getToken ( auth0 ) ;
You can’t perform that action at this time.
0 commit comments