Skip to content

Commit

Permalink
Merge pull request #49 from dwyl/callback_config#39
Browse files Browse the repository at this point in the history
[PR] Adding way to add callback path in config files.
  • Loading branch information
LuchoTurtle authored Feb 8, 2024
2 parents 8a934b1 + 2f31003 commit e996da3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion demo/lib/app_web/microsoft_auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion lib/elixir_auth_microsoft.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit e996da3

Please sign in to comment.