Apply review comments

This commit is contained in:
Alexandre de Souza 2025-05-02 13:55:25 -03:00
parent 6a37256b52
commit 20e6b08e79
No known key found for this signature in database
GPG key ID: E39228FFBA346545

View file

@ -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