summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-02 11:11:30 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:47 -0400
commit328a918ade7cf765ff8b1249241a2e80beeac927 (patch)
tree488b097f1898473ef7696c5ab3a3276ba4c5b2da
parent6e5d1c7dd44696617d8624bef9328092619f6780 (diff)
ugly dual-compatibility for ours/apache's _session formats
-rw-r--r--src/chttpd_auth.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/chttpd_auth.erl b/src/chttpd_auth.erl
index 4add8ebd..33b6d176 100644
--- a/src/chttpd_auth.erl
+++ b/src/chttpd_auth.erl
@@ -154,7 +154,8 @@ handle_session_req(#httpd{method='GET', user_ctx=UserCtx}=Req) ->
{null, "true"} ->
throw({unauthorized, <<"Please login.">>});
_False ->
- send_json(Req, {[{ok,true}, {name,Name}, {roles,Roles}]})
+ Props = [{name,Name}, {roles,Roles}],
+ send_json(Req, {[{ok,true}, {userCtx, {Props}} | Props]})
end;
handle_session_req(#httpd{method='DELETE'}=Req) ->
% logout