From 209ad1637907df094ccadcaad6af18ea9dd96e76 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Mon, 22 Feb 2010 15:52:46 +0000 Subject: 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 --- share/www/script/futon.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'share') 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); } -- cgit v1.2.3