flora-auth-jwt
Advanced tools
Comparing version 0.0.1 to 0.1.0
12
index.js
@@ -38,6 +38,10 @@ 'use strict'; | ||
api.log.trace(err); | ||
return callback(new AuthenticationError('Expired token received for JSON Web Token validation')); | ||
const e = new AuthenticationError('Expired token received for JSON Web Token validation'); | ||
e.code = 'ERR_TOKEN_EXPIRED'; | ||
return callback(e); | ||
} else if (err) { | ||
api.log.trace(err); | ||
return callback(new AuthenticationError('Invalid signature received for JSON Web Token validation')); | ||
const e = new AuthenticationError('Invalid signature received for JSON Web Token validation'); | ||
e.code = 'ERR_INVALID_TOKEN_SIGNATURE'; | ||
return callback(e); | ||
} | ||
@@ -89,4 +93,6 @@ | ||
if (ev.request._auth || !options.credentialsRequired) return next(); | ||
return next(new AuthenticationError('No authorization token was found')); | ||
const e = new AuthenticationError('No authorization token was found'); | ||
e.code = 'ERR_MISSING_TOKEN'; | ||
return next(e); | ||
}); | ||
}; |
{ | ||
"name": "flora-auth-jwt", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "JSON Web Token authentication for Flora", | ||
@@ -25,10 +25,10 @@ "main": "index.js", | ||
"dependencies": { | ||
"jsonwebtoken": "^7.2.1", | ||
"flora-errors": "^0.7.0" | ||
"jsonwebtoken": "^8.2.0", | ||
"flora-errors": "^0.8.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.10.2", | ||
"eslint-config-airbnb-base": "^11.0.0", | ||
"eslint-plugin-import": "^2.2.0" | ||
"eslint": "^4.19.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.9.0" | ||
} | ||
} |
@@ -25,1 +25,6 @@ flora-auth-jwt | ||
``` | ||
License | ||
------- | ||
[MIT](LICENSE) |
Sorry, the diff of this file is not supported yet
6336
78
30
5
+ Addedflora-errors@0.8.0(transitive)
+ Addedjsonwebtoken@8.5.1(transitive)
+ Addedlodash.includes@4.3.0(transitive)
+ Addedlodash.isboolean@3.0.3(transitive)
+ Addedlodash.isinteger@4.0.4(transitive)
+ Addedlodash.isnumber@3.0.3(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedlodash.isstring@4.0.1(transitive)
+ Addedsemver@5.7.2(transitive)
- Removedflora-errors@0.7.1(transitive)
- Removedhoek@2.16.3(transitive)
- Removedisemail@1.2.0(transitive)
- Removedjoi@6.10.1(transitive)
- Removedjsonwebtoken@7.4.3(transitive)
- Removedmoment@2.30.1(transitive)
- Removedtopo@1.1.0(transitive)
- Removedxtend@4.0.2(transitive)
Updatedflora-errors@^0.8.0
Updatedjsonwebtoken@^8.2.0