From 9f4b3e86b174749408811416544b464cb78d6755 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 14 Jul 2010 15:33:16 -0400 Subject: oops, referenced the wrong config setting for auth db --- src/chttpd_auth.erl | 8 ++++---- src/chttpd_oauth.erl | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chttpd_auth.erl b/src/chttpd_auth.erl index d1e9a7a5..26f05e1a 100644 --- a/src/chttpd_auth.erl +++ b/src/chttpd_auth.erl @@ -164,18 +164,18 @@ handle_session_req(Req) -> send_method_not_allowed(Req, "GET,HEAD,POST,DELETE"). handle_user_req(#httpd{method='POST'}=Req) -> - DbName = couch_config:get("chttpd_auth", "authentication_db", "users"), + DbName = couch_config:get("couch_httpd_auth", "authentication_db", "users"), ensure_users_db_exists(DbName), create_user(Req, DbName); handle_user_req(#httpd{method=Method, path_parts=[_]}=_Req) when Method == 'PUT' orelse Method == 'DELETE' -> throw({bad_request, <<"Username is missing">>}); handle_user_req(#httpd{method='PUT', path_parts=[_, UserName]}=Req) -> - DbName = couch_config:get("chttpd_auth", "authentication_db", "users"), + DbName = couch_config:get("couch_httpd_auth", "authentication_db", "users"), ensure_users_db_exists(DbName), update_user(Req, DbName, UserName); handle_user_req(#httpd{method='DELETE', path_parts=[_, UserName]}=Req) -> - DbName = couch_config:get("chttpd_auth", "authentication_db", "users"), + DbName = couch_config:get("couch_httpd_auth", "authentication_db", "users"), ensure_users_db_exists(DbName), delete_user(Req, DbName, UserName); handle_user_req(Req) -> @@ -205,7 +205,7 @@ get_user(UserName) -> end. load_user_from_db(UserName) -> - DbName = couch_config:get("chttpd_auth", "authentication_db", "users"), + DbName = couch_config:get("couch_httpd_auth", "authentication_db", "users"), try fabric:open_doc(DbName, UserName, []) of {ok, Doc} -> ?LOG_INFO("cache miss on username ~s", [UserName]), diff --git a/src/chttpd_oauth.erl b/src/chttpd_oauth.erl index 70995409..84506efe 100644 --- a/src/chttpd_oauth.erl +++ b/src/chttpd_oauth.erl @@ -30,7 +30,7 @@ oauth_authentication_handler(#httpd{mochi_req=MochiReq}=Req) -> % Look up the consumer key and get the roles to give the consumer set_user_ctx(Req, AccessToken) -> - DbName = couch_config:get("chttpd_auth", "authentication_db"), + DbName = couch_config:get("couch_httpd_auth", "authentication_db", "users"), ok = chttpd_auth:ensure_users_db_exists(?l2b(DbName)), Name = ?l2b(couch_config:get("oauth_token_users", AccessToken)), case chttpd_auth:get_user(Name) of -- cgit v1.2.3