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

bearer

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bearer - npm Package Compare versions

Comparing version 0.0.18 to 0.0.19

7

bearer.js

@@ -58,3 +58,3 @@ //Authentication setup

if (settings.onAuthorized){
settings.onAuthorized(req,token);
settings.onAuthorized(req, token, res);
}

@@ -68,5 +68,6 @@ next();

if (settings.onUnauthorized){
settings.onUnauthorized(req,token);
settings.onUnauthorized(req, token, res, errorMessage);
}else{
res.send({error:errorMessage});
}
res.send({error:errorMessage});
};

@@ -73,0 +74,0 @@

{
"name": "bearer",
"version": "0.0.18",
"version": "0.0.19",
"description": "Bearer authentication module using token and Authorization HTTP header",

@@ -5,0 +5,0 @@ "main": "bearer.js",

@@ -7,2 +7,6 @@ BearerJS

Backward compatibility remark for version 0.0.19
=====
`onUnauthorized` function does not automatically send the response. You will need to handle it (see example below)
Usage

@@ -107,7 +111,8 @@ =====

},
onAuthorized: function(req, token){
onAuthorized: function(req, token, res){
//console.log("this will be executed if request is OK");
},
onUnauthorized: function(req, token){
onUnauthorized: function(req, token, res, errorMessage){
//console.log(req.path, "this will be executed if request fails authentication");
//res.send({error:errorMessage});
},

@@ -114,0 +119,0 @@ secureRoutes:[

Sorry, the diff of this file is not supported yet

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