hapi-auth-bearer-simple
Advanced tools
Comparing version 3.1.0 to 4.0.0
@@ -57,3 +57,3 @@ 'use strict'; | ||
if (headerParts[0].toLowerCase() !== 'bearer') { | ||
return reply(Boom.badRequest('Token should be given in the Authorization header in "Bearer [token]" form. Example: "Authorization: Bearer azertyuiop0123"')); | ||
return reply(Boom.unauthorized(null, 'bearerAuth')); | ||
} | ||
@@ -60,0 +60,0 @@ |
{ | ||
"name": "hapi-auth-bearer-simple", | ||
"description": "Custom authentication plugin for Hapi using Bearer tokens", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"author": "Adri Van Houdt <adri@salesflare.com>", | ||
@@ -6,0 +6,0 @@ "private": false, |
@@ -237,2 +237,3 @@ 'use strict'; | ||
expect(res.statusCode).to.equal(401); | ||
expect(res.payload.message).to.be.undefined(); | ||
@@ -280,2 +281,3 @@ done(); | ||
expect(res.statusCode).to.equal(401); | ||
expect(res.payload.message).to.be.undefined(); | ||
@@ -323,2 +325,3 @@ done(); | ||
expect(res.statusCode).to.equal(401); | ||
expect(res.payload.message).to.be.undefined(); | ||
@@ -330,3 +333,3 @@ done(); | ||
it('Returns badRequest error if authorization header is not bearer', (done) => { | ||
it('Returns unAuthorized error if authorization header is not bearer', (done) => { | ||
@@ -366,3 +369,4 @@ const validFunc = (token, callback) => { | ||
expect(res.result).to.exist(); | ||
expect(res.statusCode).to.equal(400); | ||
expect(res.statusCode).to.equal(401); | ||
expect(res.payload.message).to.be.undefined(); | ||
@@ -369,0 +373,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25599
488