Skip to content

Conversation

@priore
Copy link

@priore priore commented May 25, 2018

I created a callback in the case of an expired token, with the token decoding itself

router.use(
    jwt({secret: 'ssshhhh', isExpired: (err, req, next) => {
        // check conditions
        if (req.user.uid == null) {
            return next(err);
        }

        // TODO: ...
        return next();
    }}),
    (req, res, next) => {
      // TODO: ...
});

@george-norris-salesforce

Can this be merged? @jfromaniello

@kwojcik-blockether
Copy link

@jfromaniello ?

@justin-scx
Copy link

This functionality would be useful to me.

@Spencatro
Copy link

Wow, this is exactly what I needed when I wrote #209; I think I'll just checkout & deploy this to my own npm package instead 8)

@Spencatro
Copy link

For posterity, and anyone else using this implementation: while writing tests for this, I found that invalid issuer errors can be swallowed under certain circumstances. This will hopefully be resolved in https://github.com/priore/express-jwt/pull/1 .

@jfromaniello
Copy link
Member

I am so embarrassed... but I am here after FOUR YEARS 🥹

Do you still think this is useful?

@jfromaniello
Copy link
Member

I added this feature in express-jwt@8.2.0

https://github.com/auth0/express-jwt#handling-expired-tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants