Skip to content

Commit

Permalink
Fix spec and pattern matching
Browse files Browse the repository at this point in the history
  • Loading branch information
aleDsz committed Jan 7, 2025
1 parent 85d03e3 commit 84d72c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/livebook/teams/requests.ex
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ defmodule Livebook.Teams.Requests do
Send a request to Livebook Team API to revoke session from given access token.
"""
@spec logout_identity_provider(Team.t(), String.t()) ::
{:ok, String.t()} | {:error, map() | String.t()} | {:transport_error, String.t()}
{:ok, String.t()} | {:error, map()} | {:transport_error, String.t()}
def logout_identity_provider(team, access_token) do
post("/api/v1/org/identity/revoke", %{access_token: access_token}, team)
end
Expand Down
11 changes: 3 additions & 8 deletions lib/livebook/zta/livebook_teams.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,9 @@ defmodule Livebook.ZTA.LivebookTeams do
team = Livebook.ZTA.get(name)

case Teams.Requests.logout_identity_provider(team, token) do
{:ok, _no_content} ->
:ok

{:error, %{"errors" => %{"revoked_at" => _}}} ->
{:error, "You are already logged out. We will redirect you"}

{:transport_error, reason} ->
{:error, reason}
{:ok, _no_content} -> :ok
{:error, %{}} -> {:error, "You are already logged out."}
{:transport_error, reason} -> {:error, reason}
end
end

Expand Down

0 comments on commit 84d72c8

Please sign in to comment.