Passport 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
]
...
}
$ npm install custom-passport-strategy
This library uses debug logger to help with debugging tasks. Just enable logs with:
export DEBUG='strategy-lib:*'
$ npm run format
$ npm run lint