Am 22.03.10 23:14, schrieb J Chris Anderson:
On Mar 22, 2010, at 3:11 PM, Lena Herrmann wrote:
Am 22.03.10 22:57, schrieb J Chris Anderson:
On Mar 22, 2010, at 2:43 PM, Lena Herrmann wrote:
Hi,
I still have the same problem. Now I ran out of things to try.
Here is the code: http://gist.github.com/340562
Looking at this I'm seeing that roles needs to be an array.
Can you show the output of prepareUserDoc()?
var userDoc = CouchDB.prepareUserDoc({name: "gaius", roles: "president"},
"secretpass");
console.log(JSON.stringify(userDoc)) =>
{"name":"gaius","roles":"president","_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b7eac5a","password_sha":"b6bedfb721bd4c786910319944faba0bc18a2f35","type":"user"}
All I can think is that there's an issue with the sha1 function giving
different output in your environment.
What are you running this under?
OS X 10.6.2
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2)
Gecko/20100115 Firefox/3.6
CouchDB Build 0.11.0b5592cf5-git
Maybe it'd help if I tried to duplicate here.
Are there instructions for running your test suite?
Clone my testsuite branch: http://github.com/lenalena/couchdb/tree/testsuite
and run in dev mode.
Run the testsuite by browsing to this site:
http://127.0.0.1:5984/_utils/spec/run.html
It should work in at least Firefox >= 3.6 and Safari >= 4.0.4.
I just modified the setup so that only the faulty test will run.
Thanks!
Lena
Thanks,
Chris
With roles as Array:
var userDoc = CouchDB.prepareUserDoc({name: "gaius", roles: ["president"]},
"secretpass");
console.log(JSON.stringify(userDoc)) =>
{"name":"gaius","roles":["president"],"_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b851c76","password_sha":"b299e011c82ea8e0ad4c6ccf0b3d26eb35ddec37","type":"user"}
When I just set no roles:
var userDoc = CouchDB.prepareUserDoc({name: "gaius"}, "secretpass");
console.log(JSON.stringify(userDoc)) =>
{"name":"gaius","_id":"org.couchdb.user:gaius","salt":"959de325fdcffa2c5a7fad920b81e54c","password_sha":"ba688eabc11ad9518255ac771aabbda6ab268364","type":"user","roles":[]}
Same error in each case.
Lena
Maybe something is going wrong with eg hex_sha1 or newUuids()
Chris
When trying to login, I still get a 404 with reason "Name or password is
incorrect."
Can someone try if this runs on their machine? Or am I missing something very
stupid?
Lena
Am 17.03.10 20:15, schrieb Lena Herrmann:
Am 17.03.10 18:39, schrieb J Chris Anderson:
On Mar 17, 2010, at 9:28 AM, Lena Herrmann wrote:
Hi,
my code:
var userDoc = CouchDB.prepareUserDoc({
name: "Gaius Baltar"
}, "secret");
db.save(userDoc);
CouchDB.login("Gaius Baltar", "secret");
Why does the last line get me a 401 Unauthorized?
According to the cookie_auth.js test, it should work like this. Am I
missing something?
Does it help to call _ensure_full_commit after the userDoc is saved?
Tried it, no it doesn't ...
Lena