File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,20 @@ const proxyCall = function() {
3838 function request ( ) {
3939 return new Promise ( ( resolve , reject ) => {
4040 function receiveMessage ( e ) {
41+ console . log ( "Received at auth-lib:" , e )
4142 const safeFormat = e . data . type === "SUCCESS" || e . data . type === "FAILURE"
4243 if ( safeFormat ) {
4344 window . removeEventListener ( 'message' , receiveMessage )
4445 if ( e . data . type === "SUCCESS" ) {
4546 const token = getToken ( 'v3jwt' )
4647 token ? resolve ( { token : token } ) : reject ( "v3jwt cookie not found" )
47- } else {
48- reject ( "unable to refesh token" )
48+ }
49+ if ( e . data . type === "FAILURE" ) {
50+ reject ( "unable to get refesh token" )
4951 }
5052 }
5153 }
52-
54+
5355 window . addEventListener ( 'message' , receiveMessage )
5456
5557 const payload = { type : "REFRESH_TOKEN" }
Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ const authSetup = function () {
420420 const success = {
421421 type : "SUCCESS"
422422 } ;
423- if ( e . type === "REFRESH_TOKEN" ) {
423+ if ( e . data . type === "REFRESH_TOKEN" ) {
424424 auth0 . isAuthenticated ( ) . then ( function ( isAuthenticated ) {
425425 auth0 . getTokenSilently ( ) . then ( function ( token ) {
426426 storeToken ( ) ;
You can’t perform that action at this time.
0 commit comments