Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle jwt-express errors #129

Open
m4v15 opened this issue Sep 10, 2017 · 1 comment
Open

Handle jwt-express errors #129

m4v15 opened this issue Sep 10, 2017 · 1 comment
Labels
Milestone

Comments

@m4v15
Copy link
Collaborator

m4v15 commented Sep 10, 2017

atm:

"The default behavior is to throw an error when the token is invalid, so you can add your custom logic to manage unauthorized access as follows:

app.use(function (err, req, res, next) {
  if (err.name === 'UnauthorizedError') {
    res.status(401).send('invalid token...');
  }
});

"

From the jwt-express docs

If a token is expired we probably want to direct them back to the log in page, or else we should render and nicer looking unauthorized page

@m4v15 m4v15 added the bug label Sep 10, 2017
@m4v15 m4v15 modified the milestone: Sprint 4 Sep 11, 2017
@mattlub
Copy link
Collaborator

mattlub commented Oct 23, 2017

@m4v15 can we close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants