Socket
Socket
Sign inDemoInstall

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

Bearer authorization token middleware for express.


Version published
Weekly downloads
5
decreased by-70.59%
Maintainers
1
Weekly downloads
 
Created
Source

About

Bearer authorization token middleware for express.

NPM

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.

const express = require('express');
const bearerAuthorization = require('express-authorization-bearer');
const app = express();
const router = express.Router();

router.get('/user/:id', bearerAuthorization, function (req, res) {
    res.send(`token ${req.token}`);
})

app.use('/', router);
app.listen(3000);

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Keywords

FAQs

Package last updated on 30 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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