Closed Freyskeyd closed 12 years ago
What does the form look like? Make sure the field names are set to form_login_inputUsername
and form_login_inputPassword
, as configured and that it is posting to /
.
If that doesn't help try this trick to debug the request:
app.use(function(req, res, next) {
console.log(req.method + ' ' + req.url + ' HTTP/' + req.httpVersion);
Object.keys(req.headers).forEach(function(field) {
console.log(field + ': ' + req.headers[field])
});
console.dir(req.body);
next();
}
Which will help pinpoint what the form is posting.
Hey thank's for replying
I get this :
POST / HTTP/1.1 host: 127.0.0.1:81 connection: keep-alive content-length: 62 cache-control: max-age=0 origin: http://127.0.0.1:81 user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_82) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 content-type: application/x-www-form-urlencoded accept: text/html,application/xhtml+xml,application/xml;q=0.9,/_;q=0.8 referer: http://127.0.0.1:81/ accept-encoding: gzip,deflate,sdch accept-language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 accept-charset: UTF-8,*;q=0.5 cookie: connect.sid=s%3AMAbIlsnBgEiiZ6xPP3YU3yvR.egAZGOB2M%2Fjip7qZs40nIMySnVKPe3GLZvvEQa2xfKM undefined
don't know what to do...
:/
Thank's! Le 30 sept. 2012 à 19:07, Jared Hanson notifications@github.com a écrit :
What does the form look like? Make sure the filed names are set to form_login_inputUsername and form_login_inputPassword, as configured and that it is posting to /.
If that doesn't help try this trick to debug the request:
app.use(function(req, res, next) { console.log(req.method + ' ' + req.url + ' HTTP/' + req.httpVersion); Object.keys(req.headers).forEach(function(field) { console.log(field + ': ' + req.headers[field]) }); console.dir(req.body);
next(); } Which will help pinpoint what the form is posting.
— Reply to this email directly or view it on GitHub.
ok i found the problem. i add use() before the express.bodyParser()
Hi Freyskeyd, i seem to have a similar problem. What exactly do you mean with you added use() before the express.bodyParser()?
wow, i don't remember...
Maybe the password.use before body parser?
I am also having this problem and i dont understand the fix @Freyskeyd. Pls what is the fix? I would really appreciate some help. Thanks
I'm also having the same issue, @Freyskeyd if you could send an updated version of your code, or try to explain the fix it would be much appreciated
wow, I don't know... it was 6 years ago... :/
Yo,
I've a small problem.
All my test is unauthorized...
my code :
when i post my login form i get a "unauthorized" and i've no information about what...
Can you help me? Thank's