https://github.com/ericzon/custom-passport-strategy
custom-passport-strategy
https://github.com/ericzon/custom-passport-strategy
Last synced: 7 months ago
JSON representation
custom-passport-strategy
- Host: GitHub
- URL: https://github.com/ericzon/custom-passport-strategy
- Owner: ericzon
- Created: 2019-03-10T11:50:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T17:18:19.000Z (about 4 years ago)
- Last Synced: 2025-02-26T16:46:51.831Z (about 1 year ago)
- Language: JavaScript
- Size: 41 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# custom-passport-strategy
[Passport](http://passportjs.org/) strategy for token authentication.
It offers two built-in extractors:
- extractTokenFromHeader (by default)
- extractTokenFromCookie
It accepts an array of extractors, executed sequentially to get the token from incoming request.
```
const options = {
...
extractor: [
ExtractorHelper.extractTokenFromHeader,
ExtractorHelper.extractTokenFromCookie
]
...
}
```
## Install
$ npm install custom-passport-strategy
## Debug
This library uses debug logger to help with debugging tasks. Just enable logs with:
```
export DEBUG='strategy-lib:*'
```
## Development
$ npm run format
$ npm run lint
## License
[The MIT License](http://opensource.org/licenses/MIT)