Skip to content

Commit

Permalink
[PLATFORM-1531]: Normalize auth0_base_url config value (#215)
Browse files Browse the repository at this point in the history
* Use URI to parse and join path

* URI.append_path func not in elixir 1.13
  • Loading branch information
cottinisimone authored Mar 11, 2024
1 parent 974b80e commit db0ff92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/prima_auth0_ex/openid_configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ defmodule PrimaAuth0Ex.OpenIDConfiguration do
struct!(__MODULE__, metadata)
end

defp metadata_url(base_url), do: base_url <> "/.well-known/openid-configuration"
@spec metadata_url(String.t()) :: String.t() | no_return
defp metadata_url(base_url),
do:
base_url
|> URI.new!()
|> URI.merge("/.well-known/openid-configuration")
|> URI.to_string()
end

0 comments on commit db0ff92

Please sign in to comment.