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: 4 months 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: 2025-06-01T10:33:46.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-06-01T10:34:21.000Z (5 months ago)
- Last Synced: 2025-07-19T08:16:30.077Z (4 months ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- 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
[](https://www.npmjs.com/package/ensure-token)
[](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.