Skip to content

Commit

Permalink
Merge branch 'newsletter-authentication' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
macifell committed Feb 19, 2024
2 parents 63566f6 + 7c26f73 commit d086524
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/recognizer/hal.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Recognizer.Hal do
req =
"/accounts/newsletter/interests"
|> build_url()
|> HTTPoison.get!(authentication_headers())
|> HTTPoison.get!(authorization_headers())

interests = Jason.decode!(req.body)["interests"]

Expand All @@ -19,7 +19,7 @@ defmodule Recognizer.Hal do
req =
"/accounts/newsletter?email_address=#{user["email"]}"
|> build_url()
|> HTTPoison.get!(authentication_headers())
|> HTTPoison.get!(authorization_headers())

status = Jason.decode!(req.body)["status"]

Expand All @@ -40,7 +40,7 @@ defmodule Recognizer.Hal do

"/accounts/newsletter"
|> build_url()
|> HTTPoison.post!(body, [{"content-type", "application/json"}] ++ authentication_headers())
|> HTTPoison.post!(body, [{"content-type", "application/json"}] ++ authorization_headers())
end
end

Expand All @@ -49,7 +49,7 @@ defmodule Recognizer.Hal do
Path.join([base_url, path])
end

defp authentication_headers() do
[{"authentication", "Recognizer #{Application.get_env(:recognizer, :hal_token)}"}]
defp authorization_headers() do
[{"authorization", "Recognizer #{Application.get_env(:recognizer, :hal_token)}"}]
end
end

0 comments on commit d086524

Please sign in to comment.