diff --git a/README.md b/README.md index e1dbe61..1218d78 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,12 @@ get "/auth/microsoft/callback", MicrosoftAuthController, :index With all that hooked up you should now have everything working. +> [!NOTE] +> +> You can define your callback path with an environment variable +> `MICROSOFT_CALLBACK_PATH` +> or by using the config property `:callback_path` in your config files. + ### 6.1 Give it a try! The home page of the app diff --git a/demo/lib/app_web/microsoft_auth.ex b/demo/lib/app_web/microsoft_auth.ex index 4689bb3..cfad462 100644 --- a/demo/lib/app_web/microsoft_auth.ex +++ b/demo/lib/app_web/microsoft_auth.ex @@ -159,7 +159,7 @@ defmodule ElixirAuthMicrosoft do end defp get_callback_path do - System.get_env("MICROSOFT_CALLBACK_PATH") || @default_callback_path + System.get_env("MICROSOFT_CALLBACK_PATH") || Application.get_env(:elixir_auth_microsoft, :callback_path) || @default_callback_path end diff --git a/lib/elixir_auth_microsoft.ex b/lib/elixir_auth_microsoft.ex index 80b0012..97baf03 100644 --- a/lib/elixir_auth_microsoft.ex +++ b/lib/elixir_auth_microsoft.ex @@ -161,7 +161,7 @@ defmodule ElixirAuthMicrosoft do end defp get_callback_path do - System.get_env("MICROSOFT_CALLBACK_PATH") || @default_callback_path + System.get_env("MICROSOFT_CALLBACK_PATH") || Application.get_env(:elixir_auth_microsoft, :callback_path) || @default_callback_path end