In Couchapp, I would like to have a login form that works without Javascript.
The session API wiki page states that after reassigning or failing authentication, the following _session parameter can be specified.
That sounds great, and I would like to redirect to the show function, which then can check the user credentials and display something accordingly.
I tried using the form:
<form action="/_session" method="POST"> <input type="text" name="name"> <input type="password" name="password"> <input type="hidden" name="next" value="/somewhere"> <input type="submit"> </form>
and also using curl :
curl -X POST http://localhost:5984/_session -d 'name=foo&password=bar&next=/somewhere'
but to no avail: I continue to receive code 200 (OK) if my credentials are correct and code 401 (unauthorized) if they are not, but I never get the expected 302 (redirect).
Is this feature unavailable (I'm using Couchdb 1.1), or am I doing it wrong?
If this feature no longer exists, do you have an alternative?
Simon source share