mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 19:26:07 +00:00
Select org on signup
This commit is contained in:
@@ -15,7 +15,7 @@ import { deriveArgonKey } from "@app/components/utilities/cryptography/crypto";
|
|||||||
import { saveTokenToLocalStorage } from "@app/components/utilities/saveTokenToLocalStorage";
|
import { saveTokenToLocalStorage } from "@app/components/utilities/saveTokenToLocalStorage";
|
||||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||||
import { Button, Input } from "@app/components/v2";
|
import { Button, Input } from "@app/components/v2";
|
||||||
import { completeAccountSignup } from "@app/hooks/api/auth/queries";
|
import { completeAccountSignup, useSelectOrganization } from "@app/hooks/api/auth/queries";
|
||||||
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
|
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
|
||||||
import ProjectService from "@app/services/ProjectService";
|
import ProjectService from "@app/services/ProjectService";
|
||||||
|
|
||||||
@@ -72,6 +72,7 @@ export const UserInfoSSOStep = ({
|
|||||||
const [errors, setErrors] = useState<Errors>({});
|
const [errors, setErrors] = useState<Errors>({});
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { mutateAsync: selectOrganization } = useSelectOrganization();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (providerOrganizationName !== undefined) {
|
if (providerOrganizationName !== undefined) {
|
||||||
@@ -189,6 +190,11 @@ export const UserInfoSSOStep = ({
|
|||||||
const userOrgs = await fetchOrganizations();
|
const userOrgs = await fetchOrganizations();
|
||||||
const orgId = userOrgs[0]?.id;
|
const orgId = userOrgs[0]?.id;
|
||||||
const orgSlug = userOrgs[0]?.slug;
|
const orgSlug = userOrgs[0]?.slug;
|
||||||
|
|
||||||
|
await selectOrganization({
|
||||||
|
organizationId: orgId
|
||||||
|
});
|
||||||
|
|
||||||
const project = await ProjectService.initProject({
|
const project = await ProjectService.initProject({
|
||||||
organizationSlug: orgSlug,
|
organizationSlug: orgSlug,
|
||||||
projectName: "Example Project"
|
projectName: "Example Project"
|
||||||
|
|||||||
Reference in New Issue
Block a user