Skip to content

Commit 26489f6

Browse files
Refactor
1 parent f15e85a commit 26489f6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

deps/rabbitmq_management/src/rabbit_mgmt_oauth_bootstrap.erl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@ bootstrap_oauth(Req0, State) ->
2727
{ok, cowboy_req:reply(200, #{<<"content-type">> => <<"text/javascript; charset=utf-8">>}, JSContent, Req0), State}.
2828

2929
set_oauth_settings(AuthSettings) ->
30-
case proplists:get_value(oauth_enabled, AuthSettings, false) of
31-
true -> ["set_oauth_settings(", rabbit_json:encode(rabbit_mgmt_format:format_nulls(AuthSettings)), "); "];
32-
false -> ["set_oauth_settings({oauth_enabled: false});"]
33-
end.
30+
JsonAuthSettings = rabbit_json:encode(rabbit_mgmt_format:format_nulls(AuthSettings)),
31+
["set_oauth_settings(", JsonAuthSettings, ");"].
3432

3533
set_token_auth(Req0) ->
3634
case application:get_env(rabbitmq_management, oauth_enabled, false) of

0 commit comments

Comments
 (0)