mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 05:27:52 +00:00
misc: updated org delete flow to clear session
This commit is contained in:
+4
-7
@@ -4,8 +4,8 @@ import { createNotification } from "@app/components/notifications";
|
|||||||
import { Button, DeleteActionModal } from "@app/components/v2";
|
import { Button, DeleteActionModal } from "@app/components/v2";
|
||||||
import { useOrganization, useOrgPermission } from "@app/context";
|
import { useOrganization, useOrgPermission } from "@app/context";
|
||||||
import { useDeleteOrgById } from "@app/hooks/api";
|
import { useDeleteOrgById } from "@app/hooks/api";
|
||||||
|
import { clearSession } from "@app/hooks/api/users/queries";
|
||||||
import { usePopUp } from "@app/hooks/usePopUp";
|
import { usePopUp } from "@app/hooks/usePopUp";
|
||||||
import { navigateUserToOrg } from "@app/pages/auth/LoginPage/Login.utils";
|
|
||||||
|
|
||||||
export const OrgDeleteSection = () => {
|
export const OrgDeleteSection = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -13,9 +13,7 @@ export const OrgDeleteSection = () => {
|
|||||||
|
|
||||||
const { membership } = useOrgPermission();
|
const { membership } = useOrgPermission();
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["deleteOrg"] as const);
|
||||||
"deleteOrg"
|
|
||||||
] as const);
|
|
||||||
|
|
||||||
const { mutateAsync, isPending } = useDeleteOrgById();
|
const { mutateAsync, isPending } = useDeleteOrgById();
|
||||||
|
|
||||||
@@ -32,9 +30,8 @@ export const OrgDeleteSection = () => {
|
|||||||
type: "success"
|
type: "success"
|
||||||
});
|
});
|
||||||
|
|
||||||
await navigateUserToOrg(navigate);
|
clearSession();
|
||||||
|
navigate({ to: "/login" });
|
||||||
handlePopUpClose("deleteOrg");
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user