summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/www/script/test/auth_cache.js12
-rw-r--r--src/couchdb/couch_auth_cache.erl2
2 files changed, 13 insertions, 1 deletions
diff --git a/share/www/script/test/auth_cache.js b/share/www/script/test/auth_cache.js
index 4d380e41..8c3fa943 100644
--- a/share/www/script/test/auth_cache.js
+++ b/share/www/script/test/auth_cache.js
@@ -225,7 +225,19 @@ couchTests.auth_cache = function(debug) {
T(misses_after === misses_before);
T(hits_after === (hits_before + 2));
+ T(authDb.deleteDoc(fdmanana).ok);
T(CouchDB.logout().ok);
+
+ hits_before = hits_after;
+ misses_before = misses_after;
+
+ T(CouchDB.login("fdmanana", "javascript").error === "unauthorized");
+
+ hits_after = hits();
+ misses_after = misses();
+
+ T(misses_after === (misses_before + 1));
+ T(hits_after === hits_before);
}
diff --git a/src/couchdb/couch_auth_cache.erl b/src/couchdb/couch_auth_cache.erl
index bff801fa..078bfcc1 100644
--- a/src/couchdb/couch_auth_cache.erl
+++ b/src/couchdb/couch_auth_cache.erl
@@ -289,7 +289,7 @@ refresh_entry(Db, #doc_info{high_seq = DocSeq} = DocInfo) ->
[] ->
ok;
[{UserName, {_OldCreds, ATime}}] ->
- {ok, Doc} = couch_db:open_doc(Db, DocInfo, [conflicts]),
+ {ok, Doc} = couch_db:open_doc(Db, DocInfo, [conflicts, deleted]),
NewCreds = user_creds(Doc),
true = ets:insert(?BY_USER, {UserName, {NewCreds, ATime}})
end;