Skip to content

Commit

Permalink
use auth_plug 0.5.0 which checks for JWT in URL/Headers *before* sess…
Browse files Browse the repository at this point in the history
…ion #42
  • Loading branch information
nelsonic committed Apr 22, 2020
1 parent fd81e72 commit a10e3c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion lib/auth_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,22 @@ defmodule AuthWeb.Router do
pipe_through :browser

get "/", PageController, :index
get "/admin", PageController, :admin
get "/auth/github/callback", AuthController, :github_handler
get "/auth/google/callback", AuthController, :google_handler
end


pipeline :auth do
plug(AuthPlug, %{auth_url: "https://dwylauth.herokuapp.com"})
end

scope "/", AuthWeb do
pipe_through :browser
pipe_through :auth

get "/admin", PageController, :admin
end

# Other scopes may use custom stacks.
# scope "/api", AuthWeb do
# pipe_through :api
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ defmodule Auth.Mixfile do
# https://github.com/dwyl/elixir-auth-google
{:elixir_auth_google, "~> 1.2.0"},
# https://github.com/dwyl/auth_plug
{:auth_plug, "~> 0.4.0"},
{:auth_plug, "~> 0.5.0"},

# Field Validation and Encryption: github.com/dwyl/fields
{:fields, "~> 2.4.0"},
Expand Down

0 comments on commit a10e3c8

Please sign in to comment.