From 71a7497ea7c358c354992605344e6d68a828d9de Mon Sep 17 00:00:00 2001 From: Naor Peled Date: Sat, 24 Dec 2022 03:28:58 +0200 Subject: [PATCH 1/6] initial commit --- frontend/components/basic/InputField.tsx | 1 + frontend/components/basic/buttons/Button.tsx | 4 +- frontend/pages/login.tsx | 121 ++--- frontend/pages/signup.tsx | 491 ++++++++++--------- 4 files changed, 317 insertions(+), 300 deletions(-) diff --git a/frontend/components/basic/InputField.tsx b/frontend/components/basic/InputField.tsx index 46b42c15c..08afa975d 100644 --- a/frontend/components/basic/InputField.tsx +++ b/frontend/components/basic/InputField.tsx @@ -96,6 +96,7 @@ const InputField = ( /> {props.label?.includes('Password') && ( - - + {false && ( +
+ + We are experiencing minor technical difficulties. We are working on + solving it right now. Please come back in a few minutes. +
+ )} +
+

+ Need an Infisical account? +

+ + + +
+ ); } diff --git a/frontend/pages/signup.tsx b/frontend/pages/signup.tsx index 8991dc867..d1eacaff2 100644 --- a/frontend/pages/signup.tsx +++ b/frontend/pages/signup.tsx @@ -40,8 +40,8 @@ const props = { backgroundColor: '#0d1117', color: 'white', border: '1px solid gray', - textAlign: 'center' - } + textAlign: 'center', + }, } as const; const propsPhone = { inputStyle: { @@ -56,8 +56,8 @@ const propsPhone = { backgroundColor: '#0d1117', color: 'white', border: '1px solid gray', - textAlign: 'center' - } + textAlign: 'center', + }, } as const; export default function SignUp() { @@ -148,7 +148,8 @@ export default function SignUp() { } }; - // Verifies if the imformation that the users entered (name, workspace) is there, and if the password matched the criteria. + // Verifies if the imformation that the users entered (name, workspace) is there, and if the password matched the + // criteria. const signupErrorCheck = async () => { setIsLoading(true); let errorCheck = false; @@ -169,7 +170,7 @@ export default function SignUp() { setPasswordErrorLength, setPasswordErrorNumber, setPasswordErrorLowerCase, - currentErrorCheck: errorCheck + currentErrorCheck: errorCheck, }); if (!errorCheck) { @@ -186,8 +187,8 @@ export default function SignUp() { .slice(0, 32) .padStart( 32 + (password.slice(0, 32).length - new Blob([password]).size), - '0' - ) + '0', + ), }) as { ciphertext: string; iv: string; tag: string }; localStorage.setItem('PRIVATE_KEY', PRIVATE_KEY); @@ -195,7 +196,7 @@ export default function SignUp() { client.init( { username: email, - password: password + password: password, }, async () => { client.createVerifier( @@ -204,14 +205,14 @@ export default function SignUp() { email, firstName, lastName, - organizationName: firstName + "'s organization", + organizationName: firstName + '\'s organization', publicKey: PUBLIC_KEY, ciphertext, iv, tag, salt: result.salt, verifier: result.verifier, - token: verificationToken + token: verificationToken, }); // if everything works, go the main dashboard page. @@ -230,16 +231,16 @@ export default function SignUp() { setErrorLogin, router, true, - false + false, ); incrementStep(); } catch (error) { setIsLoading(false); } } - } + }, ); - } + }, ); } else { setIsLoading(false); @@ -250,7 +251,7 @@ export default function SignUp() { const step1 = (

- {"Let'"}s get started + {'Let\''}s get started

@@ -261,260 +262,267 @@ export default function SignUp() {
-
- -
- {/*
+
{e.preventDefault();}}> +
+ +
+ {/*

I do not want to receive emails about Infisical and its products.

*/} -
-

- By creating an account, you agree to our Terms and have read and - acknowledged the Privacy Policy. -

-
-
-
+
); // Step 2 of the signup process (enter the email verification code) const step2 = ( -
-

- {"We've"} sent a verification email to{' '} -

-

- {email}{' '} -

-
- -
-
- -
- {codeError && ( - - )} -
-
-
- {/* +
{e.preventDefault();}}> +
+

+ {'We\'ve'} sent a verification email to{' '} +

+

+ {email}{' '} +

+
+ +
+
+ +
+ {codeError && ( + + )} +
+
+
+ {/* */} -

- Make sure to check your spam inbox. -

+

+ Make sure to check your spam inbox. +

+
-
+ ); // Step 3 of the signup process (enter the rest of the impformation) const step3 = ( -
-

- Almost there! -

-
- -
-
- -
-
- { - setPassword(password); - passwordCheck({ - password, - setPasswordErrorLength, - setPasswordErrorNumber, - setPasswordErrorLowerCase, - currentErrorCheck: false - }); - }} - type="password" - value={password} - isRequired - error={ - passwordErrorLength && passwordErrorNumber && passwordErrorLowerCase - } - autoComplete="new-password" - id="new-password" - /> - {passwordErrorLength || - passwordErrorLowerCase || - passwordErrorNumber ? ( -
-
- Password should contain at least: -
-
- {passwordErrorLength ? ( - - ) : ( - - )} -
- 14 characters +
{e.preventDefault();}}> +
+

+ Almost there! +

+
+ +
+
+ +
+
+ { + setPassword(password); + passwordCheck({ + password, + setPasswordErrorLength, + setPasswordErrorNumber, + setPasswordErrorLowerCase, + currentErrorCheck: false, + }); + }} + type="password" + value={password} + isRequired + error={ + passwordErrorLength && passwordErrorNumber && passwordErrorLowerCase + } + autoComplete="new-password" + id="new-password" + /> + {passwordErrorLength || + passwordErrorLowerCase || + passwordErrorNumber ? ( +
+
+ Password should contain at least: +
+
+ {passwordErrorLength ? ( + + ) : ( + + )} +
+ 14 characters +
+
+
+ {passwordErrorLowerCase ? ( + + ) : ( + + )} +
+ 1 lowercase character +
+
+
+ {passwordErrorNumber ? ( + + ) : ( + + )} +
+ 1 number +
-
- {passwordErrorLowerCase ? ( - - ) : ( - - )} -
- 1 lowercase character -
-
-
- {passwordErrorNumber ? ( - - ) : ( - - )} -
- 1 number -
-
-
- ) : ( -
- )} + ) : ( +
+ )} +
+
+
-
-
-
+ ); // Step 4 of the sign up process (download the emergency kit pdf) const step4 = ( -
-

- Save your Emergency Kit -

-
-
- If you get locked out of your account, your Emergency Kit is the only - way to sign in. +
{e.preventDefault();}}> +
+

+ Save your Emergency Kit +

+
+
+ If you get locked out of your account, your Emergency Kit is the only + way to sign in. +
+
+ We recommend you download it and keep it somewhere safe. +
-
- We recommend you download it and keep it somewhere safe. +
+ + It contains your Secret Key which we cannot access or recover for you if + you lose it.
-
-
- - It contains your Secret Key which we cannot access or recover for you if - you lose it. -
-
-
-
+ ); return ( From d25f4ccc89695ca331c3ab64dc0179d32791f861 Mon Sep 17 00:00:00 2001 From: Naor Peled Date: Sat, 24 Dec 2022 03:33:43 +0200 Subject: [PATCH 2/6] wip --- frontend/pages/login.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/pages/login.tsx b/frontend/pages/login.tsx index ef9b7a7d6..25fc85a9f 100644 --- a/frontend/pages/login.tsx +++ b/frontend/pages/login.tsx @@ -38,6 +38,10 @@ export default function Login() { * This function check if the user entered the correct credentials and should be allowed to log in. */ const loginCheck = async () => { + if (!email || !password) { + return; + } + setIsLoading(true); await attemptLogin( email, @@ -75,9 +79,11 @@ export default function Login() { />
-
{ - e.preventDefault() - }}> + setErrorLogin(false)} onSubmit={(e) => { + e.preventDefault(); + }} + >

Log in to your account From 13e78833731b284dd343a65875f544f541dc408d Mon Sep 17 00:00:00 2001 From: Naor Peled Date: Sat, 24 Dec 2022 03:34:27 +0200 Subject: [PATCH 3/6] wip --- frontend/pages/login.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/pages/login.tsx b/frontend/pages/login.tsx index 25fc85a9f..5346b77fa 100644 --- a/frontend/pages/login.tsx +++ b/frontend/pages/login.tsx @@ -114,7 +114,7 @@ export default function Login() { Forgot password?

- {errorLogin && } + {!isLoading && errorLogin && }
- {e.preventDefault();}}>
-
); // Step 2 of the signup process (enter the email verification code) const step2 = ( -
{e.preventDefault();}}>

{'We\'ve'} sent a verification email to{' '} @@ -344,12 +341,10 @@ export default function SignUp() {

- ); // Step 3 of the signup process (enter the rest of the impformation) const step3 = ( -
{e.preventDefault();}}>

Almost there! @@ -481,12 +476,10 @@ export default function SignUp() { />

- ); // Step 4 of the sign up process (download the emergency kit pdf) const step4 = ( -
{e.preventDefault();}}>

Save your Emergency Kit @@ -536,7 +529,6 @@ export default function SignUp() {

*/}
- ); return ( @@ -565,7 +557,9 @@ export default function SignUp() { /> - {step == 1 ? step1 : step == 2 ? step2 : step == 3 ? step3 : step4} +
{e.preventDefault();}}> + {step == 1 ? step1 : step == 2 ? step2 : step == 3 ? step3 : step4} +
); From 417eddaeff8b3efbb5875ee48447dd54c3797b83 Mon Sep 17 00:00:00 2001 From: Naor Peled Date: Sat, 24 Dec 2022 03:43:03 +0200 Subject: [PATCH 5/6] cleanup --- frontend/pages/login.tsx | 4 +--- frontend/pages/signup.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frontend/pages/login.tsx b/frontend/pages/login.tsx index 5346b77fa..036902de0 100644 --- a/frontend/pages/login.tsx +++ b/frontend/pages/login.tsx @@ -80,9 +80,7 @@ export default function Login() {
setErrorLogin(false)} onSubmit={(e) => { - e.preventDefault(); - }} + onChange={() => setErrorLogin(false)} onSubmit={(e) => e.preventDefault()} >

diff --git a/frontend/pages/signup.tsx b/frontend/pages/signup.tsx index 8ca92aea7..a6743f457 100644 --- a/frontend/pages/signup.tsx +++ b/frontend/pages/signup.tsx @@ -557,7 +557,7 @@ export default function SignUp() { />

- {e.preventDefault();}}> + e.preventDefault()}> {step == 1 ? step1 : step == 2 ? step2 : step == 3 ? step3 : step4}
From f020b553b38464456545b4eefb60173ffa810201 Mon Sep 17 00:00:00 2001 From: Vladyslav Matsiiako Date: Sun, 25 Dec 2022 17:28:55 -0500 Subject: [PATCH 6/6] Solving merge conflicts --- frontend/pages/signup.tsx | 313 +++++++++++++++++++------------------- 1 file changed, 157 insertions(+), 156 deletions(-) diff --git a/frontend/pages/signup.tsx b/frontend/pages/signup.tsx index 94314c151..51e2e1c05 100644 --- a/frontend/pages/signup.tsx +++ b/frontend/pages/signup.tsx @@ -354,176 +354,177 @@ export default function SignUp() { Make sure to check your spam inbox.

+ ); // Step 3 of the signup process (enter the rest of the impformation) const step3 = ( -
-

- Almost there! -

-
- -
-
- -
-
- { - setPassword(password); - passwordCheck({ - password, - setPasswordErrorLength, - setPasswordErrorNumber, - setPasswordErrorLowerCase, - currentErrorCheck: false, - }); - }} - type="password" - value={password} - isRequired - error={ - passwordErrorLength && passwordErrorNumber && passwordErrorLowerCase - } - autoComplete="new-password" - id="new-password" - /> - {passwordErrorLength || - passwordErrorLowerCase || - passwordErrorNumber ? ( -
-
- Password should contain at least: -
-
- {passwordErrorLength ? ( - - ) : ( - - )} -
- 14 characters -
-
-
- {passwordErrorLowerCase ? ( - - ) : ( - - )} -
- 1 lowercase character -
-
-
- {passwordErrorNumber ? ( - - ) : ( - - )} -
- 1 number -
+
+

+ Almost there! +

+
+ +
+
+ +
+
+ { + setPassword(password); + passwordCheck({ + password, + setPasswordErrorLength, + setPasswordErrorNumber, + setPasswordErrorLowerCase, + currentErrorCheck: false, + }); + }} + type="password" + value={password} + isRequired + error={ + passwordErrorLength && passwordErrorNumber && passwordErrorLowerCase + } + autoComplete="new-password" + id="new-password" + /> + {passwordErrorLength || + passwordErrorLowerCase || + passwordErrorNumber ? ( +
+
+ Password should contain at least: +
+
+ {passwordErrorLength ? ( + + ) : ( + + )} +
+ 14 characters
- ) : ( -
- )} -
-
-
+
+ {passwordErrorLowerCase ? ( + + ) : ( + + )} +
+ 1 lowercase character +
+
+
+ {passwordErrorNumber ? ( + + ) : ( + + )} +
+ 1 number +
+
+
+ ) : ( +
+ )}
+
+
+
); // Step 4 of the sign up process (download the emergency kit pdf) const step4 = ( -
-

- Save your Emergency Kit -

-
-
- If you get locked out of your account, your Emergency Kit is the only - way to sign in. -
-
- We recommend you download it and keep it somewhere safe. -
+
+

+ Save your Emergency Kit +

+
+
+ If you get locked out of your account, your Emergency Kit is the only + way to sign in.
-
- - It contains your Secret Key which we cannot access or recover for you if - you lose it. -
- className="text-l mt-4 text-lg text-gray-400 hover:text-gray-300 duration-200 bg-white/5 px-8 hover:bg-white/10 py-3 rounded-md cursor-pointer" - onClick={() => { - if (localStorage.getItem("projectData.id")) { - router.push("/dashboard/" + localStorage.getItem("projectData.id")); - } else { - router.push("/noprojects") - } - }} - > - Later -
*/} +
+ We recommend you download it and keep it somewhere safe.
+
+ + It contains your Secret Key which we cannot access or recover for you if + you lose it. +
+
{ + if (localStorage.getItem("projectData.id")) { + router.push("/dashboard/" + localStorage.getItem("projectData.id")); + } else { + router.push("/noprojects") + } + }} + > + Later +
+
); return (