mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 10:26:35 +00:00
Add back attribution source for non-SAML SSO case
This commit is contained in:
@@ -69,13 +69,13 @@ export const UserInfoSSOStep = ({
|
|||||||
const [nameError, setNameError] = useState(false);
|
const [nameError, setNameError] = useState(false);
|
||||||
const [organizationName, setOrganizationName] = useState("");
|
const [organizationName, setOrganizationName] = useState("");
|
||||||
const [organizationNameError, setOrganizationNameError] = useState(false);
|
const [organizationNameError, setOrganizationNameError] = useState(false);
|
||||||
|
const [attributionSource, setAttributionSource] = useState("");
|
||||||
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();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("providerOrganizationName: ", providerOrganizationName);
|
if (providerOrganizationName !== undefined) {
|
||||||
if (providerOrganizationName) {
|
|
||||||
setOrganizationName(providerOrganizationName);
|
setOrganizationName(providerOrganizationName);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
@@ -171,7 +171,8 @@ export const UserInfoSSOStep = ({
|
|||||||
providerAuthToken,
|
providerAuthToken,
|
||||||
salt: result.salt,
|
salt: result.salt,
|
||||||
verifier: result.verifier,
|
verifier: result.verifier,
|
||||||
organizationName
|
organizationName,
|
||||||
|
attributionSource
|
||||||
});
|
});
|
||||||
|
|
||||||
// unset signup JWT token and set JWT token
|
// unset signup JWT token and set JWT token
|
||||||
@@ -209,7 +210,7 @@ export const UserInfoSSOStep = ({
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full mx-auto mb-36 w-max rounded-xl md:px-8 md:mb-16">
|
<div className="h-full mx-auto mb-36 w-max rounded-xl md:px-8 md:mb-16">
|
||||||
<p className="mx-8 mb-6 flex justify-center text-xl font-bold text-medium md:mx-16 text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200">
|
<p className="mx-8 mb-6 flex justify-center text-xl font-bold text-medium md:mx-16 text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200">
|
||||||
@@ -228,18 +229,31 @@ export const UserInfoSSOStep = ({
|
|||||||
/>
|
/>
|
||||||
{nameError && <p className='text-left w-full text-xs text-red-600 mt-1 ml-1'>Please, specify your name</p>}
|
{nameError && <p className='text-left w-full text-xs text-red-600 mt-1 ml-1'>Please, specify your name</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="relative z-0 lg:w-1/6 w-1/4 min-w-[20rem] flex flex-col items-center justify-end w-full py-2 rounded-lg">
|
{providerOrganizationName === undefined && (
|
||||||
<p className='text-left w-full text-sm text-bunker-300 mb-1 ml-1 font-medium'>Organization Name</p>
|
<div className="relative z-0 lg:w-1/6 w-1/4 min-w-[20rem] flex flex-col items-center justify-end w-full py-2 rounded-lg">
|
||||||
<Input
|
<p className='text-left w-full text-sm text-bunker-300 mb-1 ml-1 font-medium'>Organization Name</p>
|
||||||
placeholder="Infisical"
|
<Input
|
||||||
value={organizationName}
|
placeholder="Infisical"
|
||||||
onChange={(e) => setOrganizationName(e.target.value)}
|
value={organizationName}
|
||||||
isRequired
|
onChange={(e) => setOrganizationName(e.target.value)}
|
||||||
className="h-12"
|
isRequired
|
||||||
disabled
|
className="h-12"
|
||||||
/>
|
disabled
|
||||||
{organizationNameError && <p className='text-left w-full text-xs text-red-600 mt-1 ml-1'>Please, specify your organization name</p>}
|
/>
|
||||||
</div>
|
{organizationNameError && <p className='text-left w-full text-xs text-red-600 mt-1 ml-1'>Please, specify your organization name</p>}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{providerOrganizationName === undefined && (
|
||||||
|
<div className="relative z-0 lg:w-1/6 w-1/4 min-w-[20rem] flex flex-col items-center justify-end w-full py-2 rounded-lg">
|
||||||
|
<p className='text-left w-full text-sm text-bunker-300 mb-1 ml-1 font-medium'>Where did you hear about us? <span className="font-light">(optional)</span></p>
|
||||||
|
<Input
|
||||||
|
placeholder=""
|
||||||
|
onChange={(e) => setAttributionSource(e.target.value)}
|
||||||
|
value={attributionSource}
|
||||||
|
className="h-12"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className="mt-2 flex lg:w-1/6 w-1/4 min-w-[20rem] max-h-60 w-full flex-col items-center justify-center rounded-lg py-2">
|
<div className="mt-2 flex lg:w-1/6 w-1/4 min-w-[20rem] max-h-60 w-full flex-col items-center justify-center rounded-lg py-2">
|
||||||
<InputField
|
<InputField
|
||||||
label={t("section.password.password")}
|
label={t("section.password.password")}
|
||||||
|
|||||||
Reference in New Issue
Block a user