Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Check is the user is already authenticated on other site.
window.onload = function() {
webAuth = new auth0.WebAuth({
domain: '',
redirectUri: '',
clientID: 'SCNHLB4vHvQlTKazudZO87LDikCyrP6s',
responseType: 'token id_token',
if (document.cookie.match(/^(.*;)?\s*CheckedSessionCookie\s*=\s*[^;]+(.*)?$/) === null) {
webAuth.checkSession({}, function (err, result){
if (!err) {
// There is a valid session from another app so let's redirect after setting the
// session state checked cookie to prevent a redirect loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.