Created
January 1, 2022 17:33
-
-
Save fidlerryan/1d46cd2c13a50bcccd5e13f625927281 to your computer and use it in GitHub Desktop.
Auth0 checkSession
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webAuth = new auth0.WebAuth({ | |
domain: 'REDACTED', | |
clientID: 'REDACTED', | |
responseType: 'token', | |
redirectUri: REDACTED | |
}); | |
webAuth.checkSession( {}, function( err, authResult ){ | |
// err if automatic parseHash fails | |
if( err ){ | |
console.log( 'From Auth0: ' + JSON.stringify( err ) ); | |
if( err.original.error === 'login_required' ){ | |
// log the user out of WP2 | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment