@patrick the JWT Verify module only throws an error if options. throw
is true
:
But the module doesn’t have any options to enable that in the UI:
Can you add that option to the UI or change the code to
exports.verify = function(options) {
const jwt = require('jsonwebtoken');
options = this.parse(options);
try {
return jwt.verify(options.token, options.key, options);
} catch (error) {
const debug = require('debug')('server-connect:jwt');
debug('jwt verify failed: %o', error);
throw error;
return { error };
}
};
To always throw an error after catching one?
Otherwise, it’s not possible to use the module in a try-catch flow like here: