trailsjs / sails-auth

Passport-based User Authentication system for sails.js applications. Designed to work well with the sails-permissions module.
https://www.npmjs.org/package/sails-auth
MIT License
265 stars 141 forks source link

action=login error #151

Open initialized-soul opened 8 years ago

initialized-soul commented 8 years ago

If I'm using local authentication and POST to /auth/local?action=login I get an 'Invalid action' error as per line 212 of passport.js which does not accept 'login' as a valid parameter. However, as per the sails-auth code, I need to specify 'login' for the action if I want to redirect users back to the login page after unsuccessful authentication. It seems that there is an incompatibility there, no?

fernandolguevara commented 7 years ago

161

rsibanez89 commented 7 years ago

For redirecting to /login page define the next parameter. <form action="/auth/local?next=/login" method="post">