From 6e6a4c726ebe536638b683e53cb5a862791dd99a Mon Sep 17 00:00:00 2001 From: shibao Date: Wed, 26 Oct 2022 22:09:25 -0400 Subject: [PATCH] add authenticated routes first --- lib/memex_web/router.ex | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/memex_web/router.ex b/lib/memex_web/router.ex index 513d691..222bd6b 100644 --- a/lib/memex_web/router.ex +++ b/lib/memex_web/router.ex @@ -54,19 +54,6 @@ defmodule MemexWeb.Router do end live_session :default do - scope "/", MemexWeb do - pipe_through [:browser] - - live "/notes", NoteLive.Index, :index - live "/notes/:id", NoteLive.Show, :show - - live "/contexts", ContextLive.Index, :index - live "/contexts/:id", ContextLive.Show, :show - - live "/pipelines", PipelineLive.Index, :index - live "/pipelines/:id", PipelineLive.Show, :show - end - scope "/", MemexWeb do pipe_through [:browser, :require_authenticated_user] @@ -87,6 +74,19 @@ defmodule MemexWeb.Router do delete "/users/settings/:id", UserSettingsController, :delete get "/users/settings/confirm_email/:token", UserSettingsController, :confirm_email end + + scope "/", MemexWeb do + pipe_through [:browser] + + live "/notes", NoteLive.Index, :index + live "/notes/:id", NoteLive.Show, :show + + live "/contexts", ContextLive.Index, :index + live "/contexts/:id", ContextLive.Show, :show + + live "/pipelines", PipelineLive.Index, :index + live "/pipelines/:id", PipelineLive.Show, :show + end end live_session :admin do