Skip to content

Commit 996c99b

Browse files
MarcialRosalesmergify[bot]
authored andcommitted
Refactor
(cherry picked from commit dc7d410)
1 parent c144df6 commit 996c99b

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
@@ -33,10 +33,8 @@ bootstrap_oauth(Req0, State) ->
3333
{ok, cowboy_req:reply(200, #{<<"content-type">> => <<"text/javascript; charset=utf-8">>}, JSContent, Req0), State}.
3434

3535
set_oauth_settings(AuthSettings) ->
36-
case proplists:get_value(oauth_enabled, AuthSettings, false) of
37-
true -> ["set_oauth_settings(", rabbit_json:encode(rabbit_mgmt_format:format_nulls(AuthSettings)), "); "];
38-
false -> ["set_oauth_settings({oauth_enabled: false});"]
39-
end.
36+
JsonAuthSettings = rabbit_json:encode(rabbit_mgmt_format:format_nulls(AuthSettings)),
37+
["set_oauth_settings(", JsonAuthSettings, ");"].
4038

4139
set_token_auth(Req0) ->
4240
case application:get_env(rabbitmq_management, oauth_enabled, false) of

0 commit comments

Comments
 (0)