Is it right that calls to the CouchDB _session endpoint always seem to return a 200 HTTP status code, even if the cookie I'm passing is absent or wrong?
Passing a wrong cookie or no cookie in my GET request headers always seems to return:
{
"ok": true,
"userCtx": {
"name": null,
"roles": []
},
"info": {
"authentication_db": "_users",
"authentication_handlers": [
"cookie",
"default"
]
}
}
When passing the correct cookie, I receive a slightly different response:
{
"ok": true,
"userCtx": {
"name": "jack",
"roles": []
},
"info": {
"authentication_db": "_users",
"authentication_handlers": [
"cookie",
"default"
],
"authenticated": "cookie"
}
}
Is this standard behaviour? If it is, which key should I rely on to assume a successful authentication? Should it be res.userCtx.name or res.info.authenticated?