Skip to content

Commit

Permalink
Merge 58101d7 into e2df740
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwiden committed Sep 19, 2016
2 parents e2df740 + 58101d7 commit 865ed87
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/main.js
Expand Up @@ -69,14 +69,18 @@ function verifyPayload(payload, audience) {

exports.verify = function (idToken, audience, callback) {
certCache.global.getFederatedGoogleCerts(function (err, keys) {
var error = null;
var decodedJWT = null;
try {
var decodedJWT = decodeJWT(idToken);
decodedJWT = decodeJWT(idToken);
verifySignature(decodedJWT, keys.keys);
verifyPayload(decodedJWT.payload, audience);

callback(null, decodedJWT.payload);
} catch (e) {
callback(e, null);
error=e;
}
if (error) {
return callback(error);
}
callback(null, decodedJWT.payload);
});
};

0 comments on commit 865ed87

Please sign in to comment.