Skip to content

Commit

Permalink
Make client able to pass :auth_required to server
Browse files Browse the repository at this point in the history
  • Loading branch information
lubien committed Mar 24, 2022
1 parent 0c79e78 commit 9ddb11a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/gnat/handshake.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ defmodule Gnat.Handshake do
{:tcp, ^tcp, operation} ->
{_, [{:info, server_settings}]} = Parsec.parse(Parsec.new(), operation)
{:ok, socket} = upgrade_connection(tcp, user_settings)
# client might want to use auth independently of the server asking
server_settings = Map.merge(server_settings, Map.take(user_settings, [:auth_required]))
settings = negotiate_settings(server_settings, user_settings)
:ok = send_connect(user_settings, settings, socket)
{:ok, socket}
Expand Down

0 comments on commit 9ddb11a

Please sign in to comment.