Skip to content

Commit

Permalink
COUCHDB-1060 - fix _admin for both clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
rnewson committed Mar 26, 2012
1 parent 40e8fe9 commit 10cddbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/couchdb/couch_auth_cache.erl
Expand Up @@ -51,7 +51,7 @@ get_user_creds(UserName) ->
nil ->
make_admin_doc(HashedPwd, Salt, [<<"_admin">>]);
UserProps when is_list(UserProps) ->
make_admin_doc(HashedPwd, Salt, [<<"_admin">>|couch_util:get_value(<<"roles">>, UserProps)])
make_admin_doc(HashedPwd, Salt, couch_util:get_value(<<"roles">>, UserProps))
end;
"-pbkdf2-" ++ HashedPwdSaltAndIterations ->
[HashedPwd, Salt, Iterations] = string:tokens(HashedPwdSaltAndIterations, ","),
Expand All @@ -73,7 +73,7 @@ make_admin_doc(HashedPwd, Salt, Roles) ->
{<<"password_sha">>, ?l2b(HashedPwd)}].

make_admin_doc(DerivedKey, Salt, Iterations, Roles) ->
[{<<"roles">>, Roles},
[{<<"roles">>, [<<"_admin">>|Roles]},
{<<"salt">>, ?l2b(Salt)},
{<<"iterations">>, list_to_integer(Iterations)},
{<<"password_scheme">>, <<"pbkdf2">>},
Expand Down

0 comments on commit 10cddbe

Please sign in to comment.