From 69d5b41e7ecfa8d1b31628af5e0b2297984ea943 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sat, 29 Aug 2009 13:42:50 +0000 Subject: merge cascading auth patch by Jason Davies, closes COUCHDB-478, fix tests git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@809134 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'share/www/script/couch.js') diff --git a/share/www/script/couch.js b/share/www/script/couch.js index e902a730..81e25f1b 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -324,7 +324,9 @@ CouchDB.createUser = function(username, password, email, roles, basicAuth) { } } var headers = {"Content-Type": "application/x-www-form-urlencoded"}; - if (!basicAuth) { + if (basicAuth) { + headers['Authorization'] = basicAuth + } else { headers['X-CouchDB-WWW-Authenticate'] = 'Cookie'; } -- cgit v1.2.3