Skip to content

Commit

Permalink
List user plug before auth
Browse files Browse the repository at this point in the history
We should not allow someone to list apps
if they don't have a user.
  • Loading branch information
josevalim committed Oct 17, 2023
1 parent 9e8c6ec commit 7c7d8c1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/livebook_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ defmodule LivebookWeb.Router do
end

pipeline :auth do
plug LivebookWeb.AuthPlug
# If identity provider is enabled and we don't have access
# we don't want to show Livebook's authentication
plug LivebookWeb.UserPlug
plug LivebookWeb.AuthPlug
end

pipeline :user do
Expand Down Expand Up @@ -141,7 +143,7 @@ defmodule LivebookWeb.Router do
end

scope "/authenticate", LivebookWeb do
pipe_through :browser
pipe_through [:browser, :user]

get "/", AuthController, :index
post "/", AuthController, :authenticate
Expand Down

0 comments on commit 7c7d8c1

Please sign in to comment.