mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-08 20:46:16 +08:00
Fix logout button with disabled "Authenticate with Livebook Teams" (#2935)
This commit is contained in:
parent
c9f619a84a
commit
42cd2af31d
3 changed files with 6 additions and 4 deletions
|
@ -130,7 +130,7 @@ defmodule LivebookWeb.LayoutComponents do
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<button
|
<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"
|
class="h-7 flex items-center text-gray-400 hover:text-white border-l-4 border-transparent hover:border-white"
|
||||||
aria-label="logout"
|
aria-label="logout"
|
||||||
phx-click="logout"
|
phx-click="logout"
|
||||||
|
|
|
@ -1560,12 +1560,12 @@ defmodule Livebook.Runtime.EvaluatorTest do
|
||||||
Evaluator.evaluate_code(evaluator, :erlang, "list_to_binary(1).", :code_4, [])
|
Evaluator.evaluate_code(evaluator, :erlang, "list_to_binary(1).", :code_4, [])
|
||||||
assert_receive {:runtime_evaluation_response, :code_4, error(message), metadata()}
|
assert_receive {:runtime_evaluation_response, :code_4, error(message), metadata()}
|
||||||
|
|
||||||
assert clean_message(message) === """
|
assert clean_message(message) =~ """
|
||||||
exception error: bad argument
|
exception error: bad argument
|
||||||
in function list_to_binary/1
|
in function list_to_binary/1
|
||||||
called as list_to_binary(1)
|
called as list_to_binary(1)
|
||||||
*** argument 1: not an iolist term
|
*** 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
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,6 +57,7 @@ defmodule Livebook.HubHelpers do
|
||||||
org_key = erpc_call(node, :create_org_key, [[org: org, key_hash: key_hash]])
|
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]])
|
org_key_pair = erpc_call(node, :create_org_key_pair, [[org: org]])
|
||||||
token = erpc_call(node, :associate_user_with_org, [user, org])
|
token = erpc_call(node, :associate_user_with_org, [user, org])
|
||||||
|
erpc_call(node, :create_billing_subscription, [org])
|
||||||
|
|
||||||
build(:team,
|
build(:team,
|
||||||
id: "team-#{org.name}",
|
id: "team-#{org.name}",
|
||||||
|
@ -66,7 +67,8 @@ defmodule Livebook.HubHelpers do
|
||||||
org_key_id: org_key.id,
|
org_key_id: org_key.id,
|
||||||
org_public_key: org_key_pair.public_key,
|
org_public_key: org_key_pair.public_key,
|
||||||
session_token: token,
|
session_token: token,
|
||||||
teams_key: teams_key
|
teams_key: teams_key,
|
||||||
|
billing_status: %{disabled: false, type: nil}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue