jaredhanson / jaredhanson/passport

Allow the ability to pass session:false when creating a new strategy

Open
#97 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
23.5k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

This way, you don't need to continually pass this parameter in every single route when authenticating.

For example:

``` javascript
passport.use(new BearerStrategy(
{session: false},
function(token, done) {
User.findOne({api_key: token}, function(err, user) {
if (err) { return done(err); }
if (!user) { return done(null, false, {message: "Token is not valid"}); }
return done(null, user);
});
}
));
```

Contributor guide

Open the contributing guide

Research direction

The issue names BearerStrategy configuration and route authentication but no files or tests. Start by tracing how strategy options and the session setting are handled, then inspect existing authentication tests. Done means session:false configured when creating a strategy is honored without repeating it on every route.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authentication, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.