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

express-authorization-bearer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-authorization-bearer - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

0

index.js
'use strict';
module.exports = require('./src');

2

package.json
{
"name": "express-authorization-bearer",
"version": "1.0.0",
"version": "1.0.1",
"description": "Bearer authorization token middleware for express.",

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

# About
Bearer authorization token middleware for express.
[![NPM](https://nodei.co/npm/express-authorization-bearer.png)](https://nodei.co/npm/express-authorization-bearer/)
## Purpose?
This module will attempt to extract a bearer token from a request from this location:
* The value from the header `Authorization: Bearer <token>`.
If a token is found, it will be stored on `req.token`. Otherwise, it will abort the request immediately by sending code 401.
```js
const express = require('express');
const bearerAuthorization = require('express-authorization-bearer');
const app = express();
const router = app.Router();
app.use('/', router.get('user/:id', bearerAuthorization, function (req, res) {
res.send(`token ${req.token}`);
}));
app.listen(3000);
```
# License
This project is licensed under the MIT License - see the LICENSE.md file for details
This project is licensed under the MIT License - see the LICENSE.md file for details

@@ -0,0 +0,0 @@ 'use strict';

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