Skip to content

Commit

Permalink
Assign authInfo when using assignProperty option.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Sep 21, 2021
1 parent b220766 commit 7047316
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/middleware/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,16 @@ module.exports = function authenticate(passport, name, options, callback) {
}
if (options.assignProperty) {
req[options.assignProperty] = user;
return next();
if (options.authInfo !== false) {
passport.transformAuthInfo(info, req, function(err, tinfo) {
if (err) { return next(err); }
req.authInfo = tinfo;
next();
});
} else {
next();
}
return;
}

req.logIn(user, options, function(err) {
Expand Down

0 comments on commit 7047316

Please sign in to comment.