Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/stuart_client_elixir/authenticator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ defmodule StuartClientElixir.Authenticator do
client_secret: client_secret,
site: site
)
|> OAuth2.Client.put_serializer("application/json", Jason)
end

defp cache_exists?(%Credentials{client_id: client_id}),
Expand Down
7 changes: 7 additions & 0 deletions test/stuart_client_elixir/authenticator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ defmodule StuartClientElixirTest.AuthenticatorTest do
new: fn oauth_params ->
sample_client(oauth_params)
end,
put_serializer: fn oauth_client, content_type, serializer ->
client_with_serializer(oauth_client, content_type, serializer)
end,
get_token: fn oauth_client ->
get_token_response(oauth_client)
end
Expand Down Expand Up @@ -158,6 +161,10 @@ defmodule StuartClientElixirTest.AuthenticatorTest do
}
end

defp client_with_serializer(oauth_client, content_type, serializer) do
%{oauth_client | serializers: %{content_type => serializer}}
end

defp get_token_response(%OAuth2.Client{client_secret: "client-secret"}) do
{:ok,
sample_client_with_token(
Expand Down