Logout
End the session and clear our cookie. Returns a LOCAL logout_url for the browser to land
on — the originating app’s own signed-out page — so we never depend on WorkOS’s hosted-logout
redirect.
WHY NOT the WorkOS hosted logout URL: its return_to must be a WorkOS-registered redirect.
The operator console origin isn’t registered there, so WorkOS ignored return_to=<ops> and
fell back to its default (the tenant app), dumping the operator on …/login?next=%2Fdashboard.
Instead we revoke the WorkOS session SERVER-SIDE (no redirect needed) and bounce the browser
locally — fully under our control on every host.
return_to is the originating app’s origin (allow-list validated). The tenant app’s root
redirects through /dashboard, so for it we land straight on /login (the signed-out page);
the operator console root already renders its own signed-out screen, so we land there.
Query Parameters
Response
Successful Response