summaryrefslogtreecommitdiff
path: root/share/www
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-02-22 15:52:46 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-02-22 15:52:46 +0000
commit209ad1637907df094ccadcaad6af18ea9dd96e76 (patch)
treecc925cd29d1ff12bab6aadfb4d79bfcd98c7328a /share/www
parentc6e3a9e284609c6b33dd2fcb5d691ab2b963f538 (diff)
fixed race condition in admin creation - thanks Matt Goodall
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@912636 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www')
-rw-r--r--share/www/script/futon.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/share/www/script/futon.js b/share/www/script/futon.js
index 7401b4cc..57a9aceb 100644
--- a/share/www/script/futon.js
+++ b/share/www/script/futon.js
@@ -69,9 +69,15 @@
if (!validateUsernameAndPassword(data, callback)) return;
$.couch.config({
success : function() {
- callback();
- doLogin(data.name, data.password, callback);
- doSignup(data.name, null, callback, false);
+ doLogin(data.name, data.password, function(errors) {
+ if(!$.isEmptyObject(errors)) {
+ callback(errors);
+ return;
+ }
+ doSignup(data.name, null, function(errors) {
+ callback(errors);
+ }, false);
+ });
}
}, "admins", data.name, data.password);
}