diff --git a/lib/auth_web/router.ex b/lib/auth_web/router.ex index bf0e344d..49a4ba5a 100644 --- a/lib/auth_web/router.ex +++ b/lib/auth_web/router.ex @@ -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 diff --git a/mix.exs b/mix.exs index 740fb6d5..a7668dca 100644 --- a/mix.exs +++ b/mix.exs @@ -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"},