mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-10 06:54:28 +08:00
Apply review comments
This commit is contained in:
parent
6a37256b52
commit
20e6b08e79
1 changed files with 1 additions and 12 deletions
|
@ -68,7 +68,7 @@ defmodule LivebookWeb.AppAuthHook do
|
|||
{:cont,
|
||||
assign(socket,
|
||||
app_authenticated?: app_authenticated?,
|
||||
app_authorized?: app_authorized?(session, app),
|
||||
app_authorized?: Livebook.Apps.authorized?(app, socket.assigns.current_user),
|
||||
app_settings: app_settings
|
||||
)}
|
||||
else
|
||||
|
@ -86,17 +86,6 @@ defmodule LivebookWeb.AppAuthHook do
|
|||
LivebookWeb.AuthPlug.authorized?(session, uri.port)
|
||||
end
|
||||
|
||||
defp app_authorized?(session, app) do
|
||||
user =
|
||||
LivebookWeb.UserPlug.build_current_user(
|
||||
session,
|
||||
session["identity_data"],
|
||||
session["user_data"]
|
||||
)
|
||||
|
||||
Livebook.Apps.authorized?(app, user)
|
||||
end
|
||||
|
||||
defp handle_info(:logout, socket) do
|
||||
{:halt, redirect(socket, to: ~p"/logout")}
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue