fix: always redirect to /devices when stopping impersonation
Previously redirected to /dashboard or /orgs based on whether the superuser had organizations. Now always goes to /devices for consistency. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
039bce3938
commit
cbff651f83
1 changed files with 1 additions and 8 deletions
|
|
@ -883,13 +883,6 @@ defmodule ToweropsWeb.UserAuth do
|
|||
ip_address: ip
|
||||
})
|
||||
|
||||
# Dashboard page
|
||||
redirect_path =
|
||||
case Towerops.Organizations.list_user_organizations(superuser.id) do
|
||||
[_first_org | _] -> ~p"/dashboard"
|
||||
[] -> ~p"/orgs"
|
||||
end
|
||||
|
||||
conn
|
||||
|> delete_session(:superuser_id)
|
||||
|> delete_session(:target_user_id)
|
||||
|
|
@ -897,7 +890,7 @@ defmodule ToweropsWeb.UserAuth do
|
|||
|> assign(:current_scope, Scope.for_user(superuser))
|
||||
|> maybe_set_default_organization(superuser)
|
||||
|> put_flash(:info, t_admin("Stopped impersonating"))
|
||||
|> redirect(to: redirect_path)
|
||||
|> redirect(to: ~p"/devices")
|
||||
end
|
||||
|
||||
## Login tracking helpers
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue