+ setLoginEmailChosen(true);
+ }}
+ size="sm"
+ isFullWidth
+ className='h-12'
+ colorSchema="primary"
+ variant="outline_bg"
+ > Continue with Email
+
diff --git a/frontend/src/views/Login/components/MFAStep/MFAStep.tsx b/frontend/src/views/Login/components/MFAStep/MFAStep.tsx
index 3eebba058..fe4a0fd01 100644
--- a/frontend/src/views/Login/components/MFAStep/MFAStep.tsx
+++ b/frontend/src/views/Login/components/MFAStep/MFAStep.tsx
@@ -36,6 +36,7 @@ type Props = {
email: string;
password: string;
providerAuthToken?: string;
+ callbackPort?: string | null;
}
interface VerifyMfaTokenError {
@@ -53,7 +54,8 @@ interface VerifyMfaTokenError {
export const MFAStep = ({
email,
password,
- providerAuthToken
+ providerAuthToken,
+ callbackPort
}: Props) => {
const { createNotification } = useNotificationContext();
const router = useRouter();
@@ -77,9 +79,7 @@ export const MFAStep = ({
}
setIsLoading(true);
- const queryParams = new URLSearchParams(window.location.search)
- if (queryParams && queryParams.get("callback_port")){
- const callbackPort = queryParams.get("callback_port")
+ if (callbackPort){
// attemptCliLogin
const isCliLoginSuccessful = await attemptCliLoginMfa({
diff --git a/frontend/src/views/Login/components/PasswordStep/PasswordStep.tsx b/frontend/src/views/Login/components/PasswordStep/PasswordStep.tsx
index 07a0b1ba3..6076e76bb 100644
--- a/frontend/src/views/Login/components/PasswordStep/PasswordStep.tsx
+++ b/frontend/src/views/Login/components/PasswordStep/PasswordStep.tsx
@@ -2,14 +2,17 @@ import { useState } from "react";
import { useTranslation } from "react-i18next";
import Link from "next/link";
import { useRouter } from "next/router"
+import axios from "axios"
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+import attemptCliLogin from "@app/components/utilities/attemptCliLogin";
import attemptLogin from "@app/components/utilities/attemptLogin";
import { Button, Input } from "@app/components/v2";
import getOrganizations from "@app/pages/api/organization/getOrgs";
type Props = {
providerAuthToken: string;
+ callbackPort?: string;
email: string;
password: string;
setPassword: (password: string) => void;
@@ -18,6 +21,7 @@ type Props = {
export const PasswordStep = ({
providerAuthToken,
+ callbackPort,
email,
password,
setPassword,
@@ -31,34 +35,64 @@ export const PasswordStep = ({
const handleLogin = async () => {
try {
setIsLoading(true);
- const loginAttempt = await attemptLogin({
- email,
- password,
- providerAuthToken,
- });
+
+ if (callbackPort) {
+ // attemptCliLogin
+ const isCliLoginSuccessful = await attemptCliLogin({
+ email,
+ password,
+ providerAuthToken
+ })
- if (loginAttempt && loginAttempt.success) {
- // case: login was successful
+ if (isCliLoginSuccessful && isCliLoginSuccessful.success) {
- if (loginAttempt.mfaEnabled) {
- // TODO: deal with MFA
- // case: login requires MFA step
- setIsLoading(false);
- setStep(2);
- return;
+ if (isCliLoginSuccessful.mfaEnabled) {
+ // case: login requires MFA step
+ setStep(2);
+ setIsLoading(false);
+ return;
+ }
+ // case: login was successful
+ const cliUrl = `http://localhost:${callbackPort}`
+
+ // send request to server endpoint
+ const instance = axios.create()
+ await instance.post(cliUrl, { ...isCliLoginSuccessful.loginResponse })
+
+ // cli page
+ router.push("/cli-redirect");
+
+ // on success, router.push to cli Login Successful page
}
-
- // case: login does not require MFA step
- const userOrgs = await getOrganizations();
- const userOrg = userOrgs[0]._id;
- setIsLoading(false);
- createNotification({
- text: "Successfully logged in",
- type: "success"
+ } else {
+ const loginAttempt = await attemptLogin({
+ email,
+ password,
+ providerAuthToken,
});
- router.push(`/org/${userOrg?._id}/overview`);
- }
+ if (loginAttempt && loginAttempt.success) {
+ // case: login was successful
+
+ if (loginAttempt.mfaEnabled) {
+ // TODO: deal with MFA
+ // case: login requires MFA step
+ setIsLoading(false);
+ setStep(2);
+ return;
+ }
+
+ // case: login does not require MFA step
+ const userOrgs = await getOrganizations();
+ const userOrg = userOrgs[0]._id;
+ setIsLoading(false);
+ createNotification({
+ text: "Successfully logged in",
+ type: "success"
+ });
+ router.push(`/org/${userOrg?._id}/overview`);
+ }
+ }
} catch (err) {
setIsLoading(false);
createNotification({
diff --git a/frontend/src/views/Login/components/SAMLSSOStep/SAMLSSOStep.tsx b/frontend/src/views/Login/components/SAMLSSOStep/SAMLSSOStep.tsx
index 77e7e6cb4..8ff363d36 100644
--- a/frontend/src/views/Login/components/SAMLSSOStep/SAMLSSOStep.tsx
+++ b/frontend/src/views/Login/components/SAMLSSOStep/SAMLSSOStep.tsx
@@ -13,6 +13,8 @@ export const SAMLSSOStep = ({
const [ssoIdentifier, setSSOIdentifier] = useState("");
const { t } = useTranslation();
+ const queryParams = new URLSearchParams(window.location.search);
+
return (
@@ -37,7 +39,8 @@ export const SAMLSSOStep = ({
colorSchema="primary"
variant="outline_bg"
onClick={() => {
- window.open(`/api/v1/sso/redirect/saml2/${ssoIdentifier}`);
+ const callbackPort = queryParams.get("callback_port");
+ window.open(`/api/v1/sso/redirect/saml2/${ssoIdentifier}${callbackPort ? `?callback_port=${callbackPort}` : ""}`);
window.close();
}}
isFullWidth
diff --git a/frontend/src/views/Org/MembersPage/components/OrgMembersTable/OrgMembersTable.tsx b/frontend/src/views/Org/MembersPage/components/OrgMembersTable/OrgMembersTable.tsx
index a995661c9..3a39560ca 100644
--- a/frontend/src/views/Org/MembersPage/components/OrgMembersTable/OrgMembersTable.tsx
+++ b/frontend/src/views/Org/MembersPage/components/OrgMembersTable/OrgMembersTable.tsx
@@ -6,6 +6,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { yupResolver } from "@hookform/resolvers/yup";
import * as yup from "yup";
+import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
import {
Button,
DeleteActionModal,
@@ -26,9 +27,11 @@ import {
Th,
THead,
Tr,
- UpgradePlanModal} from "@app/components/v2";
-import { useWorkspace } from "@app/context";
+ UpgradePlanModal
+} from "@app/components/v2";
+import { useOrganization , useWorkspace } from "@app/context";
import { usePopUp, useToggle } from "@app/hooks";
+import { useGetSSOConfig } from "@app/hooks/api";
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
import { OrgUser, Workspace } from "@app/hooks/api/types";
@@ -69,6 +72,9 @@ export const OrgMembersTable = ({
setCompleteInviteLink
}: Props) => {
const router = useRouter();
+ const { createNotification } = useNotificationContext();
+ const { currentOrg } = useOrganization();
+ const { data: ssoConfig, isLoading: isLoadingSSOConfig } = useGetSSOConfig(currentOrg?._id ?? "");
const [searchMemberFilter, setSearchMemberFilter] = useState("");
const {data: serverDetails } = useFetchServerStatus()
const { workspaces } = useWorkspace();
@@ -79,7 +85,7 @@ export const OrgMembersTable = ({
"upgradePlan",
"setUpEmail"
] as const);
-
+
useEffect(() => {
if (router.query.action === "invite") {
handlePopUpOpen("addMember");
@@ -152,6 +158,15 @@ export const OrgMembersTable = ({
}
onClick={() => {
+ if (!isLoadingSSOConfig && ssoConfig && ssoConfig.isActive) {
+ createNotification({
+ text: "You cannot invite users when SAML SSO is configured for your organization",
+ type: "error"
+ });
+
+ return;
+ }
+
if (isMoreUserNotAllowed) {
handlePopUpOpen("upgradePlan");
} else {
diff --git a/frontend/src/views/Project/IPAllowListPage/IPAllowlistPage.tsx b/frontend/src/views/Project/IPAllowListPage/IPAllowlistPage.tsx
new file mode 100644
index 000000000..9940d6bae
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/IPAllowlistPage.tsx
@@ -0,0 +1,15 @@
+import { IPAllowlistSection } from "./components";
+
+export const IPAllowlistPage = () => {
+ return (
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx
new file mode 100644
index 000000000..d6e746d1a
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistModal.tsx
@@ -0,0 +1,193 @@
+import { useEffect } from "react";
+import { Controller, useForm } from "react-hook-form";
+import { yupResolver } from "@hookform/resolvers/yup";
+import * as yup from "yup";
+
+import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+import {
+ Button,
+ FormControl,
+ Input,
+ Modal,
+ ModalContent
+} from "@app/components/v2";
+import { useWorkspace } from "@app/context";
+import {
+ useAddTrustedIp,
+ useGetMyIp,
+ useUpdateTrustedIp
+} from "@app/hooks/api";
+import { UsePopUpState } from "@app/hooks/usePopUp";
+
+const schema = yup.object({
+ ipAddress: yup.string().required("IP address is required"),
+ comment: yup.string()
+}).required();
+
+export type FormData = yup.InferType
;
+
+type Props = {
+ popUp: UsePopUpState<["trustedIp"]>;
+ handlePopUpClose: (popUpName: keyof UsePopUpState<["trustedIp"]>) => void;
+ handlePopUpToggle: (popUpName: keyof UsePopUpState<["trustedIp"]>, state?: boolean) => void;
+};
+
+export const IPAllowlistModal = ({
+ popUp,
+ handlePopUpClose,
+ handlePopUpToggle
+}: Props) => {
+ const { createNotification } = useNotificationContext();
+ const { data, isLoading } = useGetMyIp();
+
+ const { currentWorkspace } = useWorkspace();
+ const addTrustedIp = useAddTrustedIp();
+ const updateTrustedIp = useUpdateTrustedIp();
+
+ const {
+ control,
+ setValue,
+ handleSubmit,
+ reset,
+ formState: { isSubmitting }
+ } = useForm({
+ resolver: yupResolver(schema)
+ });
+
+ useEffect(() => {
+ const trustedIpData = popUp?.trustedIp?.data as {
+ ipAddress: string;
+ comment: string;
+ prefix: number;
+ };
+
+ if (popUp?.trustedIp?.data) {
+ reset({
+ ipAddress: `${trustedIpData.ipAddress}${trustedIpData.prefix !== undefined ? `/${trustedIpData.prefix}` : ""}`,
+ comment: trustedIpData.comment
+ });
+ } else {
+ reset({
+ ipAddress: "",
+ comment: ""
+ });
+ }
+
+ }, [popUp?.trustedIp?.data]);
+
+ const onIPAllowlistModalSubmit = async ({
+ ipAddress,
+ comment
+ }: FormData) => {
+ try {
+ if (!currentWorkspace?._id) return;
+
+ if (popUp?.trustedIp?.data) {
+ await updateTrustedIp.mutateAsync({
+ workspaceId: currentWorkspace._id,
+ trustedIpId: (popUp?.trustedIp?.data as { trustedIpId: string })?.trustedIpId,
+ ipAddress,
+ comment,
+ isActive: true
+ });
+ } else {
+ await addTrustedIp.mutateAsync({
+ workspaceId: currentWorkspace._id,
+ ipAddress,
+ comment,
+ isActive: true
+ });
+ }
+
+ createNotification({
+ text: `Successfully ${popUp?.trustedIp?.data ? "updated" : "added"} trusted IP`,
+ type: "success"
+ });
+
+ reset();
+ handlePopUpClose("trustedIp");
+ } catch (err) {
+ createNotification({
+ text: `Failed to ${popUp?.trustedIp?.data ? "update" : "add"} trusted IP`,
+ type: "error"
+ });
+ }
+ }
+
+ return (
+ {
+ handlePopUpToggle("trustedIp", isOpen);
+ reset();
+ }}
+ >
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx
new file mode 100644
index 000000000..729ab549e
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistSection.tsx
@@ -0,0 +1,105 @@
+import { faPlus } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+import {
+ Button,
+ DeleteActionModal,
+ UpgradePlanModal
+} from "@app/components/v2";
+import { useSubscription,useWorkspace } from "@app/context";
+import {
+ useDeleteTrustedIp
+} from "@app/hooks/api";
+import { usePopUp } from "@app/hooks/usePopUp";
+
+import { IPAllowlistModal } from "./IPAllowlistModal";
+import { IPAllowlistTable } from "./IPAllowlistTable";
+
+export const IPAllowlistSection = () => {
+ const { createNotification } = useNotificationContext();
+ const { mutateAsync } = useDeleteTrustedIp();
+ const { subscription } = useSubscription();
+ const { currentWorkspace } = useWorkspace();
+
+ const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
+ "trustedIp",
+ "deleteTrustedIp",
+ "upgradePlan"
+ ] as const);
+
+ const onDeleteTrustedIpSubmit = async (trustedIpId: string) => {
+ try {
+
+ if (!currentWorkspace?._id) return;
+
+ await mutateAsync({
+ workspaceId: currentWorkspace._id,
+ trustedIpId
+ });
+
+ createNotification({
+ text: "Successfully deleted IP access range",
+ type: "success"
+ });
+
+ handlePopUpClose("deleteTrustedIp");
+ } catch (err) {
+ console.log(err);
+ createNotification({
+ text: "Failed to delete IP access range",
+ type: "error"
+ });
+ }
+ }
+
+ return (
+
+
+
+ IP Allowlist
+
+
+
+
+
+
handlePopUpToggle("deleteTrustedIp", isOpen)}
+ deleteKey="confirm"
+ onDeleteApproved={() =>
+ onDeleteTrustedIpSubmit((popUp?.deleteTrustedIp?.data as { trustedIpId: string })?.trustedIpId)
+ }
+ />
+ handlePopUpToggle("upgradePlan", isOpen)}
+ text="You can use IP allowlisting if you switch to Infisical's Pro plan."
+ />
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx
new file mode 100644
index 000000000..d160f15db
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/components/IPAllowlistTable.tsx
@@ -0,0 +1,162 @@
+import { faGlobe, faPencil, faXmark } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+import {
+ EmptyState,
+ IconButton,
+ Table,
+ TableContainer,
+ TableSkeleton,
+ TBody,
+ Td,
+ Th,
+ THead,
+ Tr,
+ UpgradePlanModal
+} from "@app/components/v2";
+import { useSubscription, useWorkspace } from "@app/context";
+import {
+ useGetTrustedIps
+} from "@app/hooks/api";
+import { UsePopUpState } from "@app/hooks/usePopUp";
+
+type Props = {
+ popUp: UsePopUpState<["upgradePlan"]>;
+ handlePopUpOpen: (
+ popUpName: keyof UsePopUpState<["trustedIp", "deleteTrustedIp", "upgradePlan"]>,
+ data?: {
+ trustedIpId: string;
+ ipAddress?: string;
+ comment?: string;
+ isActive?: boolean;
+ prefix?: number;
+ },
+ ) => void;
+ handlePopUpToggle: (popUpName: keyof UsePopUpState<["upgradePlan"]>, state?: boolean) => void;
+};
+
+export const IPAllowlistTable = ({
+ popUp,
+ handlePopUpOpen,
+ handlePopUpToggle
+}: Props) => {
+ const { subscription } = useSubscription();
+ const { currentWorkspace } = useWorkspace();
+ const { data, isLoading } = useGetTrustedIps(currentWorkspace?._id ?? "");
+
+ const formatType = (type: string, prefix?: number) => {
+ return `${type.slice(0, 2).toUpperCase() + type.slice(2)} ${(prefix !== undefined) ? "CIDR" : ""}`;
+ }
+
+ return (
+
+
+
+
+
+ | IP Address / Range |
+ Format |
+ Comment |
+ {/* Status | */}
+ |
+
+
+
+ {!isLoading && data && data?.length > 0 && data
+ .sort((a, b) => a.ipAddress.localeCompare(b.ipAddress))
+ .map(({
+ _id,
+ ipAddress,
+ comment,
+ type,
+ prefix,
+ isActive
+ }) => {
+ return (
+
+ |
+ {`${ipAddress}${(prefix !== undefined) ? `/${prefix}` : ""}`}
+ |
+
+ {formatType(type, prefix)}
+ |
+
+ {comment}
+ |
+ {/*
+
+ | */}
+
+ {
+ if (subscription?.ipAllowlisting) {
+ handlePopUpOpen("trustedIp", {
+ trustedIpId: _id,
+ ipAddress,
+ comment,
+ prefix,
+ isActive
+ });
+ } else {
+ handlePopUpOpen("upgradePlan");
+ }
+ }}
+ colorSchema="primary"
+ variant="plain"
+ ariaLabel="update"
+ >
+
+
+ {
+ if (subscription?.ipAllowlisting) {
+ handlePopUpOpen("deleteTrustedIp", {
+ trustedIpId: _id
+ });
+ } else {
+ handlePopUpOpen("upgradePlan");
+ }
+ }}
+ size="lg"
+ colorSchema="danger"
+ variant="plain"
+ ariaLabel="update"
+ >
+
+
+ |
+
+ );
+ })}
+ {isLoading && }
+ {!isLoading && data && data?.length === 0 && (
+
+ |
+
+ |
+
+ )}
+
+
+
+
handlePopUpToggle("upgradePlan", isOpen)}
+ text="You can use IP allowlisting if you switch to Infisical's Pro plan."
+ />
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/views/Project/IPAllowListPage/components/index.tsx b/frontend/src/views/Project/IPAllowListPage/components/index.tsx
new file mode 100644
index 000000000..d4146cb4d
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/components/index.tsx
@@ -0,0 +1 @@
+export { IPAllowlistSection } from "./IPAllowlistSection";
\ No newline at end of file
diff --git a/frontend/src/views/Project/IPAllowListPage/index.tsx b/frontend/src/views/Project/IPAllowListPage/index.tsx
new file mode 100644
index 000000000..e7a407184
--- /dev/null
+++ b/frontend/src/views/Project/IPAllowListPage/index.tsx
@@ -0,0 +1 @@
+export { IPAllowlistPage } from "./IPAllowlistPage";
\ No newline at end of file
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
index 4eba19a50..743106998 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingDetailsTab/PmtMethodsTable.tsx
@@ -11,7 +11,8 @@ import {
Td,
Th,
THead,
- Tr} from "@app/components/v2";
+ Tr
+} from "@app/components/v2";
import { useOrganization } from "@app/context";
import {
useDeleteOrgPmtMethod,
diff --git a/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx b/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
index 9050f9d5f..612052a36 100644
--- a/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
+++ b/frontend/src/views/Settings/BillingSettingsPage/components/BillingReceiptsTab/InvoicesTable.tsx
@@ -11,7 +11,8 @@ import {
Td,
Th,
THead,
- Tr} from "@app/components/v2";
+ Tr
+} from "@app/components/v2";
import { useOrganization } from "@app/context";
import {
useGetOrgInvoices
diff --git a/frontend/src/views/Settings/PersonalSettingsPage/AuthMethodSection/AuthMethodSection.tsx b/frontend/src/views/Settings/PersonalSettingsPage/AuthMethodSection/AuthMethodSection.tsx
index 7ca84318d..a3eec451d 100644
--- a/frontend/src/views/Settings/PersonalSettingsPage/AuthMethodSection/AuthMethodSection.tsx
+++ b/frontend/src/views/Settings/PersonalSettingsPage/AuthMethodSection/AuthMethodSection.tsx
@@ -102,7 +102,7 @@ export const AuthMethodSection = () => {
defaultValue={field.value}
{...field}
onValueChange={(e) => onChange(e)}
- className="w-full"
+ className="w-full bg-mineshaft-800 border border-mineshaft-600"
>
{authMethods.map((authMethod) => {
return (
diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentTable.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentTable.tsx
index c433801e1..4e901989d 100644
--- a/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentTable.tsx
+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/EnvironmentTable.tsx
@@ -18,7 +18,7 @@ import { UsePopUpState } from "@app/hooks/usePopUp";
type Props = {
handlePopUpOpen: (
- popUpName: keyof UsePopUpState<["updateEnv", "deleteEnv", "deleteEnv", "upgradePlan"]>,
+ popUpName: keyof UsePopUpState<["updateEnv", "deleteEnv", "upgradePlan"]>,
{
name,
slug
diff --git a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
index 4c0f50f44..fed039467 100644
--- a/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
+++ b/frontend/src/views/Signup/components/UserInfoSSOStep/UserInfoSSOStep.tsx
@@ -69,13 +69,13 @@ export const UserInfoSSOStep = ({
const [nameError, setNameError] = useState(false);
const [organizationName, setOrganizationName] = useState("");
const [organizationNameError, setOrganizationNameError] = useState(false);
+ const [attributionSource, setAttributionSource] = useState("");
const [errors, setErrors] = useState({});
const [isLoading, setIsLoading] = useState(false);
const { t } = useTranslation();
useEffect(() => {
- console.log("providerOrganizationName: ", providerOrganizationName);
- if (providerOrganizationName) {
+ if (providerOrganizationName !== undefined) {
setOrganizationName(providerOrganizationName);
}
}, []);
@@ -112,10 +112,6 @@ export const UserInfoSSOStep = ({
const privateKey = encodeBase64(secretKeyUint8Array);
const publicKey = encodeBase64(publicKeyUint8Array);
localStorage.setItem("PRIVATE_KEY", privateKey);
-
- console.log("make");
- console.log("email: ", email);
- console.log("password: ", password);
client.init(
{
@@ -175,7 +171,8 @@ export const UserInfoSSOStep = ({
providerAuthToken,
salt: result.salt,
verifier: result.verifier,
- organizationName
+ organizationName,
+ attributionSource
});
// unset signup JWT token and set JWT token
@@ -213,7 +210,7 @@ export const UserInfoSSOStep = ({
setIsLoading(false);
}
};
-
+
return (
@@ -232,18 +229,31 @@ export const UserInfoSSOStep = ({
/>
{nameError &&
Please, specify your name
}
-
-
Organization Name
-
setOrganizationName(e.target.value)}
- isRequired
- className="h-12"
- disabled
- />
- {organizationNameError &&
Please, specify your organization name
}
-
+ {providerOrganizationName === undefined && (
+
+
Organization Name
+
setOrganizationName(e.target.value)}
+ isRequired
+ className="h-12"
+ disabled
+ />
+ {organizationNameError &&
Please, specify your organization name
}
+
+ )}
+ {providerOrganizationName === undefined && (
+
+
Where did you hear about us? (optional)
+
setAttributionSource(e.target.value)}
+ value={attributionSource}
+ className="h-12"
+ />
+
+ )}