Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

Commit 1b66cbf

Browse files
authoredAug 20, 2020
Merge pull request #436 from MattheuM/bugfix/357-malformedJson
Fix for 357, malformed json bug
2 parents c005443 + bdc7c19 commit 1b66cbf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎lib/bearerstrategy.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,13 @@ util.inherits(Strategy, passport.Strategy);
287287
Strategy.prototype.jwtVerify = function jwtVerifyFunc(req, token, metadata, optionsToValidate, done) {
288288
const self = this;
289289

290-
const decoded = jws.decode(token);
290+
let decoded = null;
291+
try {
292+
decoded = jws.decode(token);
293+
} catch (error) {
294+
log.error(error);
295+
}
296+
291297
let PEMkey = null;
292298

293299
if (decoded == null) {

0 commit comments

Comments
 (0)
This repository has been archived.