3
4

2 回答 2

2

I ran into this same problem, and solved it by adding this to my route handler for login:

req.body = req.query;

Maybe not the perfect solution, but it's certainly better than hacking passport. ;)

Also note that there's a pending request in passport-local to fix this problem: https://github.com/jaredhanson/passport-local/pull/12

于 2012-07-07T14:14:20.100 回答
0

Maybe https://github.com/yarax/passport-url strategy will be useful for you

It allows to authenticate users with a token giving by GET request

var url = new UrlStrategy({
    failRedirect : "/login",
    varName : "secret"
}, function (secret, done) { // put your check logic here
    if (secret == 'foo') done(null, {id:'bar'});
    else done("wrong");
});

passport.use(url);
于 2015-02-24T15:41:06.617 回答