secure-auth-kit 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ export const authenticate = (req, res, next) => {
15
15
  }
16
16
  const config = getConfig();
17
17
  const payload = verifyToken(token, config.jwt);
18
- if (payload.type === 'access') {
18
+ if (payload.type !== 'access') {
19
19
  throw AppError.unauthorized('Invalid token type', 'TOKEN_TYPE_MISMATCH');
20
20
  }
21
21
  req.user = { id: payload.userId, email: payload.email };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secure-auth-kit",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Authentication toolkit for Express and MongoDB",
5
5
  "repository": {
6
6
  "type": "git",