Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created November 27, 2018 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunokrebs/6e36dbbd57059100a60d923bb3400a20 to your computer and use it in GitHub Desktop.
Save brunokrebs/6e36dbbd57059100a60d923bb3400a20 to your computer and use it in GitHub Desktop.
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();
});
})
}
@matoow
Copy link

matoow commented Nov 27, 2018

Cracking, that makes more sense, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment