jaredhanson / passport-http

HTTP Basic and Digest authentication strategies for Passport and Node.js.

Home Page:https://www.passportjs.org/packages/passport-http/?utm_source=github&utm_medium=referral&utm_campaign=passport-http&utm_content=about

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add auth info in basic callback

rgjamkhedkar opened this issue · comments

At the moment you are not taking info in basic auth callback. So extra information about authenticated client cannot be passed to req.authInfo object.
I changed code as follows.
this._verify(userid, password, function(err, user, info) {
if (err) { return self.error(err); }
if (!user) { return self.fail(self._challenge()); }
self.success(user, info);
});

I am sure others would also benefit if you change code as above.

Also noticed the same issue. Just need to include info as an argument to verified (basic.js line 88) and the self.success call (basic.js line 91)

+1. I think it's a very interesting change because allow send customized data back to client. It is also very simple one. Thank you

Pull request created...

#48