apache / apache/couchdb-nano

Cookie auth don't work?

Open
#145 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
167
Avg merge
1h
Merged PRs (30d)
1

Description

Can't get session details from couch db (cookies don't set)

## Expected Behavior
Request with cookies.

## Current Behavior
Request without cookies.
Session response with null name

## Possible Solution
?

## Steps to Reproduce (for bugs)

`const nano = require('nano')({ url: 'http://localhost:5984', requestDefaults: { jar: true } })

const username = 'jan'

const userpass = 'apple'

export function dbtestauth () {
nano.auth(username, userpass).then((body) => {
console.log('Body - ' + JSON.stringify(body))
})
}
//Body - {"ok":true,"name":"jan","roles":[]}

export function dbtestsession () {
nano.session().then((body) => {
console.log(JSON.stringify(body))
})
}
//{"ok":true,"userCtx":{"name":null,"roles":[]},"info":{"authentication_db":"_users","authentication_handlers":["cookie","default"]}}
`

## Context

## Your Environment

* Version used: 8,0,0
* Browser Name and version: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.99 YaBrowser/19.1.0.2644 Yowser/2.5 Safari/537.36
* Operating System and version (desktop or mobile): Win 10 desktop
* Link to your project:

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction using nano.auth(), nano.session(), and requestDefaults: { jar: true } against the stated CouchDB environment. Compare the authentication response with the subsequent session request and inspect the library entry points for those methods. Done means the authenticated session returns the expected user name and cookies are retained; no source files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
api, authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.