dwyl/elixir-auth-microsoft

feature/support taking callback_uri from custom configuration

robdembitel opened this issue · 2 comments

Hello, would it be possible to also make it possible to set the callback path via the configuration file?

System.get_env("MICROSOFT_CALLBACK_PATH") || @default_callback_path

I would suggest to align it with the other environment variables, like here:

System.get_env("MICROSOFT_TOKEN_URL") || Application.get_env(:elixir_auth_microsoft, :token_url) || @default_token_url

so that set it also via the config file like e.g. this:

config :elixir_auth_microsoft,
  client_id: "",
  client_secret: "",
  post_logout_redirect_uri: "http://localhost:4000/auth/microsoft/logout",
  callback_uri: "http://localhost:4000/auth/microsoft/custom-callback-uri",

So this would be cool:

  defp get_callback_path do
    System.get_env("MICROSOFT_CALLBACK_PATH") || Application.get_env(:elixir_auth_microsoft, :callback_uri) || @default_callback_path
  end

Cheers!

Sure thing!
I'll open a micro-PR to get this working and publish it in the next version :)

Feature added and it's part of the v1.3.0 release of the package, which is already published. https://hex.pm/packages/elixir_auth_microsoft

Thanks!