Skip to content

Commit

Permalink
fix token auth
Browse files Browse the repository at this point in the history
  • Loading branch information
RoadRunnr committed Nov 11, 2024
1 parent 6c11c81 commit f705d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,11 @@ flush_batch(Data0) ->

client_info(#{server_info := ServerInfo} = Data) ->
%% Include user and name iff the server requires it
FieldsList = [verbose, pedantic, tls_required, auth_token, name, lang,
FieldsList = [verbose, pedantic, tls_required, name, lang,
version, headers, no_responders],
NewFieldsList =
case maps:get(auth_required, ServerInfo, false) of
true -> [user, pass | FieldsList];
true -> [user, pass, auth_token | FieldsList];
_ -> FieldsList
end,
Nats = maps:with(NewFieldsList, Data),
Expand Down

0 comments on commit f705d97

Please sign in to comment.