Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-auth-bearer-simple

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-auth-bearer-simple - npm Package Compare versions

Comparing version 3.1.0 to 4.0.0

2

lib/index.js

@@ -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();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc