mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 05:19:49 +00:00
added signup v3 endpoints and developed initial new signup flow
This commit is contained in:
@@ -8,6 +8,7 @@ interface Props {
|
||||
protectedKey: string;
|
||||
protectedKeyIV: string;
|
||||
protectedKeyTag: string;
|
||||
providerAuthToken?: string;
|
||||
publicKey: string;
|
||||
encryptedPrivateKey: string;
|
||||
encryptedPrivateKeyIV: string;
|
||||
@@ -49,9 +50,10 @@ const completeAccountInformationSignup = async ({
|
||||
encryptedPrivateKeyTag,
|
||||
salt,
|
||||
verifier,
|
||||
organizationName
|
||||
organizationName,
|
||||
providerAuthToken,
|
||||
}: Props) => {
|
||||
const { data } = await apiRequest.post('/api/v2/signup/complete-account/signup', {
|
||||
const { data } = await apiRequest.post('/api/v3/signup/complete-account/signup', {
|
||||
email,
|
||||
firstName,
|
||||
lastName,
|
||||
@@ -64,7 +66,8 @@ const completeAccountInformationSignup = async ({
|
||||
encryptedPrivateKeyTag,
|
||||
salt,
|
||||
verifier,
|
||||
organizationName
|
||||
organizationName,
|
||||
providerAuthToken,
|
||||
});
|
||||
|
||||
return data;
|
||||
|
||||
@@ -12,7 +12,6 @@ interface Login1 {
|
||||
const login1 = async (loginDetails: {
|
||||
email: string;
|
||||
clientPublicKey: string;
|
||||
userId?: string;
|
||||
}) => {
|
||||
const response = await fetch("/api/v2/auth/login1", {
|
||||
method: "POST",
|
||||
|
||||
@@ -20,7 +20,6 @@ interface Login2Response {
|
||||
const login2 = async (loginDetails: {
|
||||
email: string;
|
||||
clientProof: string;
|
||||
userId?: string;
|
||||
}) => {
|
||||
const response = await fetch('/api/v2/auth/login2', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -25,7 +25,6 @@ export default function Login() {
|
||||
const [isLoginWithEmail, setIsLoginWithEmail] = useState(false);
|
||||
const {
|
||||
providerAuthToken,
|
||||
userId,
|
||||
email: providerEmail,
|
||||
setProviderAuthToken
|
||||
} = useProviderAuth();
|
||||
@@ -57,7 +56,6 @@ export default function Login() {
|
||||
if (providerAuthToken && step === 1) {
|
||||
return (
|
||||
<PasswordInputStep
|
||||
userId={userId}
|
||||
email={providerEmail}
|
||||
password={password}
|
||||
setPassword={setPassword}
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function SignUp() {
|
||||
const { data: serverDetails } = useFetchServerStatus();
|
||||
const [isSignupWithEmail, setIsSignupWithEmail] = useState(false);
|
||||
const { t } = useTranslation();
|
||||
const { providerAuthToken } = useProviderAuth();
|
||||
const { email: providerEmail, providerAuthToken } = useProviderAuth();
|
||||
|
||||
if (providerAuthToken && step < 3) {
|
||||
setStep(3);
|
||||
@@ -99,7 +99,7 @@ export default function SignUp() {
|
||||
return (
|
||||
<>
|
||||
<button type='button' className='text-white' onClick={() => {
|
||||
window.open('/api/v1/auth/login/google')
|
||||
window.open('/api/v1/oauth/redirect/google')
|
||||
}}>
|
||||
Continue with Google
|
||||
</button>
|
||||
@@ -127,13 +127,14 @@ export default function SignUp() {
|
||||
return (
|
||||
<UserInfoStep
|
||||
incrementStep={incrementStep}
|
||||
email={email}
|
||||
email={email || providerEmail}
|
||||
password={password}
|
||||
setPassword={setPassword}
|
||||
firstName={firstName}
|
||||
setFirstName={setFirstName}
|
||||
lastName={lastName}
|
||||
setLastName={setLastName}
|
||||
providerAuthToken={providerAuthToken}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -142,7 +143,7 @@ export default function SignUp() {
|
||||
return (
|
||||
<DownloadBackupPDF
|
||||
incrementStep={incrementStep}
|
||||
email={email}
|
||||
email={email || providerEmail}
|
||||
password={password}
|
||||
name={`${firstName} ${lastName}`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user