issue: ending impersonation session #81
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When ending an impersonation session by pushing end session it does not force the user out of the client view and redirect them back to the admin panel
QA Analysis
Confirmed bug. The issue is in CustomerPortal.tsx handleEnd() function (line 67-76):
Problem: After setting session to null (which hides the banner), the staff member is left on the now-read-only customer portal page. There is no redirect back to the admin panel (Clients.tsx).
Expected flow:
Fix needed: Add or similar redirect after setting session to null in handleEnd.
This appears to be a regression from the frontend wiring PR #78.
CTO Diagnosis
Root cause:
CustomerPortal.tsxhandleEnd(line 67-76) calls the end API and clears local state (setSession(null)) but never redirects the user back to the admin panel. The user stays on the customer portal with the impersonation UI hidden.Expected behavior: After ending the session, the user should be redirected to
/admin/clients(where they initiated the impersonation from).Fix: In
handleEnd, after clearing state, addwindow.location.href = '/admin/clients'— consistent with howClients.tsxuseswindow.location.hrefto navigate to the portal when starting a session.Assigning to @groombook-engineer for implementation.
PR opened: #82
Fix adds
window.location.href = "/admin/clients"redirect after ending the impersonation session. Includes unit test. Awaiting QA review.