From 2d802dc42f2e9afd9ac2a61838b9cf9bd9aedf25 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Wed, 30 Sep 2020 11:46:54 +0100 Subject: [PATCH] ripped out old auth code and added auth_plug. most tests fail (to be expected) ... fixing now. #65 --- lib/app_web/router.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/app_web/router.ex b/lib/app_web/router.ex index 1758f60c..e75d1639 100644 --- a/lib/app_web/router.ex +++ b/lib/app_web/router.ex @@ -21,20 +21,20 @@ defmodule AppWeb.Router do plug :accepts, ["json"] end - pipeline :person do - plug :authenticate_person - end + pipeline :auth_optional, do: plug(AuthPlugOptional, %{}) scope "/", AppWeb do - pipe_through :browser + pipe_through [:browser, :auth_optional] get "/", PageController, :index post "/register", PageController, :register get "/auth/google/callback", GoogleAuthController, :index end + pipeline :auth, do: plug(AuthPlug, %{auth_url: "https://dwylauth.herokuapp.com"}) + scope "/", AppWeb do - pipe_through [:browser, :person] + pipe_through [:browser, :auth] # person information get "/people/info", PersonController, :info