diff options
Diffstat (limited to 'lib/polyjuice/client/endpoint/post_login.ex')
-rw-r--r-- | lib/polyjuice/client/endpoint/post_login.ex | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/lib/polyjuice/client/endpoint/post_login.ex b/lib/polyjuice/client/endpoint/post_login.ex index 808708a..c300d3f 100644 --- a/lib/polyjuice/client/endpoint/post_login.ex +++ b/lib/polyjuice/client/endpoint/post_login.ex @@ -40,17 +40,14 @@ defmodule Polyjuice.Client.Endpoint.PostLogin do ] defimpl Polyjuice.Client.Endpoint.Proto do - def http_spec( - %Polyjuice.Client.Endpoint.PostLogin{ - type: type, - identifier: identifier, - password: password, - token: token, - device_id: device_id, - initial_device_display_name: initial_device_display_name - }, - base_url - ) do + def http_spec(%Polyjuice.Client.Endpoint.PostLogin{ + type: type, + identifier: identifier, + password: password, + token: token, + device_id: device_id, + initial_device_display_name: initial_device_display_name + }) do body = [ [{"type", type}, {"identifier", identifier}], @@ -66,21 +63,12 @@ defmodule Polyjuice.Client.Endpoint.PostLogin do |> Map.new() |> Jason.encode_to_iodata!() - %Polyjuice.Client.Endpoint.HttpSpec{ - method: :post, - headers: [ - {"Accept", "application/json"}, - {"Content-Type", "application/json"} - ], - url: - URI.merge( - base_url, - "#{Polyjuice.Client.prefix_r0()}/login" - ) - |> to_string(), + Polyjuice.Client.Endpoint.HttpSpec.post( + :r0, + "login", body: body, auth_required: false - } + ) end def transform_http_result(req, status_code, resp_headers, body) do |