Fix logout button with disabled "Authenticate with Livebook Teams" (#2935)

This commit is contained in:
Alexandre de Souza 2025-02-17 10:56:52 -03:00 committed by GitHub
parent c9f619a84a
commit 42cd2af31d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -130,7 +130,7 @@ defmodule LivebookWeb.LayoutComponents do
</div>
<div class="flex flex-col">
<button
:if={Livebook.Config.logout_enabled?()}
:if={Livebook.Config.logout_enabled?() and @current_user.email != nil}
class="h-7 flex items-center text-gray-400 hover:text-white border-l-4 border-transparent hover:border-white"
aria-label="logout"
phx-click="logout"

View file

@ -1560,12 +1560,12 @@ defmodule Livebook.Runtime.EvaluatorTest do
Evaluator.evaluate_code(evaluator, :erlang, "list_to_binary(1).", :code_4, [])
assert_receive {:runtime_evaluation_response, :code_4, error(message), metadata()}
assert clean_message(message) === """
assert clean_message(message) =~ """
exception error: bad argument
in function list_to_binary/1
called as list_to_binary(1)
*** argument 1: not an iolist term
in call from erl_eval:do_apply/7 (erl_eval.erl, line 915)\
in call from erl_eval:do_apply/7 (erl_eval.erl, line\
"""
end
end

View file

@ -57,6 +57,7 @@ defmodule Livebook.HubHelpers do
org_key = erpc_call(node, :create_org_key, [[org: org, key_hash: key_hash]])
org_key_pair = erpc_call(node, :create_org_key_pair, [[org: org]])
token = erpc_call(node, :associate_user_with_org, [user, org])
erpc_call(node, :create_billing_subscription, [org])
build(:team,
id: "team-#{org.name}",
@ -66,7 +67,8 @@ defmodule Livebook.HubHelpers do
org_key_id: org_key.id,
org_public_key: org_key_pair.public_key,
session_token: token,
teams_key: teams_key
teams_key: teams_key,
billing_status: %{disabled: false, type: nil}
)
end