Created
November 27, 2018 23:08
-
-
Save brunokrebs/6e36dbbd57059100a60d923bb3400a20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
handleAuthentication() { | |
return new Promise((resolve, reject) => { | |
this.auth0.parseHash((err, authResult) => { | |
if (err) return reject(err); | |
if (!authResult || !authResult.idToken) { | |
return reject(err); | |
} | |
this.idToken = authResult.idToken; | |
this.profile = authResult.idTokenPayload; | |
// set the time that the id token will expire at | |
this.expiresAt = authResult.idTokenPayload.exp * 1000; | |
resolve(); | |
}); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cracking, that makes more sense, thank you