Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ethern-myth/ensure-token
A package for ensuring bearer token is available in the header of the HTTP Request using Express
https://github.com/ethern-myth/ensure-token
bearer-authentication middleware typescript
Last synced: about 1 month ago
JSON representation
A package for ensuring bearer token is available in the header of the HTTP Request using Express
- Host: GitHub
- URL: https://github.com/ethern-myth/ensure-token
- Owner: Ethern-Myth
- License: mit
- Created: 2024-02-18T12:40:21.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-21T06:27:05.000Z (4 months ago)
- Last Synced: 2024-12-02T09:05:44.713Z (about 1 month ago)
- Topics: bearer-authentication, middleware, typescript
- Language: TypeScript
- Homepage: https://github.com/Ethern-Myth/ensure-token
- Size: 165 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Ensure Token
A package for ensuring bearer token is available in the header of the HTTP Request using Express
[![npm downloads](https://img.shields.io/npm/dm/ensure-token)](https://www.npmjs.com/package/ensure-token)
[![NPM](https://nodei.co/npm/ensure-token.png)](https://nodei.co/npm/ensure-token/)
### Installation
``` cmd
npm install ensure-token --save
OR
yarn add ensure-token
OR
pnpm install ensure-token
```### Usage
javascript or typescript
``` javascript
import { ensureToken } from 'ensure-token';
```Add the ensureToken in your route like this:
``` javascript
app.get('/your-route', ensureToken, (req, res) => {})
```#### This will work on bearer tokens only for now. More Verifications will be added later.
### Don't forget to like this repo. If you have any questions feel free to ask!
Created by [Ethern Myth](http://www.github.com/ethern-myth)
Licensed under the [MIT license](http://www.opensource.org/licenses/mit-license).
Last updated 18/02/2024.