JWT Verify Module Doesn't Throw Error

@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:

CleanShot 2022-11-16 at 16.20.54

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:
CleanShot 2022-11-16 at 16.22.44


1 Like

This should be fixed now in Wappler 5.2.5

1 Like

This topic was automatically closed after 32 hours. New replies are no longer allowed.