Skip to content

Instantly share code, notes, and snippets.

@fidlerryan
Created January 1, 2022 17:33
Show Gist options
  • Save fidlerryan/1d46cd2c13a50bcccd5e13f625927281 to your computer and use it in GitHub Desktop.
Save fidlerryan/1d46cd2c13a50bcccd5e13f625927281 to your computer and use it in GitHub Desktop.
Auth0 checkSession
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