Remove useAssume from layouts now that we have the /assume page that redirects

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-10 18:12:20 +04:00
parent 260f196f9c
commit 795b0a8de2
6 changed files with 16 additions and 29 deletions

View File

@@ -58,7 +58,7 @@ export function useAssume(params: UseAssumeParameters) {
if (error instanceof UnAuthenticatedError) {
const search = new URLSearchParams([
["organization-id", organizationId],
["redirect-path", afterAssumePath ?? window.location.href],
["redirect-path", afterAssumePath ?? window.location.pathname + window.location.search],
]);
void navigate({ pathname: "/auth/login", search: "?" + search.toString() });
@@ -76,7 +76,7 @@ export function useAssume(params: UseAssumeParameters) {
switch (result.__typename) {
case "PasswordRequired":
search.set("organization-id", organizationId);
search.set("redirect-path", afterAssumePath ?? window.location.href);
search.set("redirect-path", afterAssumePath ?? window.location.pathname + window.location.search);
void navigate({ pathname: "/auth/passord-login", search: "?" + search.toString() });
break;