Skip to content

Commit 0334af0

Browse files
Remove log statement
1 parent 91df75a commit 0334af0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

deps/rabbitmq_management/src/rabbit_mgmt_oauth_bootstrap.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ init(Req0, State) ->
3737
rabbit_mgmt_headers:set_common_permission_headers(Req0, ?MODULE), ?MODULE), State).
3838

3939
bootstrap_oauth(Req0, State) ->
40-
{Req1, AuthSettings} = enrich_oauth_settings(Req0, rabbit_mgmt_wm_auth:authSettings()),
40+
AuthSettings0 = rabbit_mgmt_wm_auth:authSettings(),
41+
{Req1, AuthSettings} = enrich_oauth_settings(Req0, AuthSettings0),
4142
Dependencies = oauth_dependencies(),
4243
{Req2, SetTokenAuth} = set_token_auth(AuthSettings, Req1),
4344
JSContent = import_dependencies(Dependencies) ++
@@ -55,7 +56,7 @@ enrich_oauth_settings(Req0, AuthSettings) ->
5556
{preferred_auth_mechanism, Args} -> {Req1, [{preferred_auth_mechanism, Args} | AuthSettings]};
5657
{strict_auth_mechanism, Args} -> {Req1, [{strict_auth_mechanism, Args} | AuthSettings]};
5758
{error, Reason} -> ?LOG_DEBUG("~p", [Reason]),
58-
{Req1, AuthSettings}
59+
{Req1, AuthSettings}
5960
end.
6061
get_auth_mechanism(Req) ->
6162
case get_auth_mechanism_from_cookies(Req) of
@@ -113,8 +114,8 @@ set_token_auth(AuthSettings, Req0) ->
113114
["set_token_auth('", Token, "');"]
114115
};
115116
_ ->
116-
Cookies = cowboy_req:parse_cookies(Req0),
117-
case proplists:get_value(?OAUTH2_ACCESS_TOKEN, Cookies) of
117+
Cookies = cowboy_req:parse_cookies(Req0),
118+
case lists:keyfind(?OAUTH2_ACCESS_TOKEN, 1, Cookies) of
118119
{_, Token} ->
119120
{
120121
cowboy_req:set_resp_cookie(
@@ -126,7 +127,7 @@ set_token_auth(AuthSettings, Req0) ->
126127
}),
127128
["set_token_auth('", Token, "');"]
128129
};
129-
undefined -> {
130+
false -> {
130131
Req0,
131132
[]
132133
}

0 commit comments

Comments
 (0)