Skip to content

Commit

Permalink
Testing Idea by Alex Billingsley mentioned in dwyl#317
Browse files Browse the repository at this point in the history
  • Loading branch information
das-peter authored Nov 26, 2019
1 parent cec60ba commit 87e6795
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,26 @@ internals.implementation = function(server, options) {
return h.continue;
},

verify: async function(auth) {
/*verify: async function(auth) {
const token = auth.artifacts;
const decoded = JWT.decode(token, {
complete: options.complete || false,
});
const { keys } = await internals.getKeys(decoded, options);
internals.verifyJwt(token, keys, options);
},*/
verify: async function(auth) {
const token = auth.artifacts;
const decoded = JWT.decode(token, {
complete: options.complete || false,
});
if (options.verify) {
// verify using the provided function
options.verify(decoded, /*not sure what to do about request*/);
} else {
const { keys } = await internals.getKeys(decoded, options);
internals.verifyJwt(token, keys, options);
}
},
};
};

0 comments on commit 87e6795

Please sign in to comment.