summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_auth.erl
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-02-01 23:03:02 +0000
committerJan Lehnardt <jan@apache.org>2010-02-01 23:03:02 +0000
commit8ef616ca80246e5c104c5212af0c28ab2412b9d4 (patch)
tree99dd3632126420a4d7441230ba4e3d8ef9d67d56 /src/couchdb/couch_httpd_auth.erl
parentee8a76e1cad33831448dbf12a394c51aa65230f4 (diff)
fix unused variable warnings, remove unused code.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@905438 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_auth.erl')
-rw-r--r--src/couchdb/couch_httpd_auth.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/couchdb/couch_httpd_auth.erl b/src/couchdb/couch_httpd_auth.erl
index d1081611..505194a9 100644
--- a/src/couchdb/couch_httpd_auth.erl
+++ b/src/couchdb/couch_httpd_auth.erl
@@ -118,7 +118,7 @@ get_user(UserName) ->
{<<"salt">>, ?l2b(Salt)},
{<<"password_sha">>, ?l2b(HashedPwd)}]
end;
- Else ->
+ _Else ->
get_user_props_from_db(UserName)
end.
@@ -139,12 +139,12 @@ get_user_props_from_db(UserName) ->
?LOG_ERROR("Invalid user doc. Id: ~p",[DocId]),
nil
end;
- Else ->
+ _Else ->
throw({unauthorized, <<"User document conflict must be resolved before login.">>})
end
catch
- throw:Throw ->
- nil
+ throw:_Throw ->
+ nil
end.
% this should handle creating the ddoc
@@ -163,7 +163,7 @@ ensure_auth_ddoc_exists(Db, DDocId) ->
try couch_httpd_db:couch_doc_open(Db, DDocId, nil, []) of
_Foo -> ok
catch
- _:Error ->
+ _:_Error ->
% create the design document
{ok, AuthDesign} = auth_design_doc(DDocId),
{ok, _Rev} = couch_db:update_doc(Db, AuthDesign, []),
@@ -248,9 +248,9 @@ cookie_authentication_handler(#httpd{mochi_req=MochiReq}=Req) ->
Cookie ->
[User, TimeStr | HashParts] = try
AuthSession = couch_util:decodeBase64Url(Cookie),
- [A, B | Cs] = string:tokens(?b2l(AuthSession), ":")
+ [_A, _B | _Cs] = string:tokens(?b2l(AuthSession), ":")
catch
- _:Error ->
+ _:_Error ->
Reason = <<"Malformed AuthSession cookie. Please clear your cookies.">>,
throw({bad_request, Reason})
end,
@@ -416,11 +416,9 @@ handle_session_req(#httpd{method='DELETE'}=Req) ->
handle_session_req(Req) ->
send_method_not_allowed(Req, "GET,HEAD,POST,DELETE").
-maybe_value(Key, undefined, Fun) -> [];
+maybe_value(_Key, undefined, _Fun) -> [];
maybe_value(Key, Else, Fun) ->
[{Key, Fun(Else)}].
-maybe_value(Key, undefined) -> [];
-maybe_value(Key, Else) -> [{Key, Else}].
auth_name(String) when is_list(String) ->
[_,_,_,_,_,Name|_] = re:split(String, "[\\W_]", [{return, list}]),