Skip to content

Commit

Permalink
fix(auth): reject with 401 non-expiration-set tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-gs committed Jun 12, 2024
1 parent 68f00d0 commit c6683c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/initializers/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module.exports = (App, Config) => {
const tokenWithoutExpiration = !payload.exp;

if (tokenWithoutExpiration) {
return done(new Error('Invalid token, sign in again'));
return done(null, false, { message: 'Invalid token, sign in again' });
}

/* Temporal compatibility with old JWT
Expand Down

0 comments on commit c6683c3

Please sign in to comment.