mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 03:31:27 +00:00
Fix: Cleanup
This commit is contained in:
@@ -25,7 +25,7 @@ import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
import { useServerConfig } from "@app/context";
|
||||
import {
|
||||
completeAccountSignupInvite,
|
||||
selectOrganization,
|
||||
useSelectOrganization,
|
||||
verifySignupInvite
|
||||
} from "@app/hooks/api/auth/queries";
|
||||
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
|
||||
@@ -63,6 +63,8 @@ export default function SignupInvite() {
|
||||
const email = (parsedUrl.to as string)?.replace(" ", "+").trim();
|
||||
const { config } = useServerConfig();
|
||||
|
||||
const { mutateAsync: selectOrganization } = useSelectOrganization();
|
||||
|
||||
useEffect(() => {
|
||||
if (!config.allowSignUp) {
|
||||
router.push("/login");
|
||||
@@ -175,8 +177,9 @@ export default function SignupInvite() {
|
||||
|
||||
const orgId = userOrgs[0].id;
|
||||
|
||||
const { token: newJwtToken } = await selectOrganization({ organizationId: orgId });
|
||||
SecurityClient.setToken(newJwtToken);
|
||||
if (!orgId) throw new Error("You are not part of any organization");
|
||||
|
||||
await selectOrganization({ organizationId: orgId });
|
||||
|
||||
localStorage.setItem("orgData.id", orgId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user