);
diff --git a/frontend/components/basic/Layout.tsx b/frontend/components/basic/Layout.tsx
index 235bfaa25..ef8eda727 100644
--- a/frontend/components/basic/Layout.tsx
+++ b/frontend/components/basic/Layout.tsx
@@ -183,6 +183,7 @@ export default function Layout({ children }: LayoutProps) {
if (
userWorkspaces.length == 0 &&
router.asPath != "/noprojects" &&
+ !router.asPath.includes("home")&&
!router.asPath.includes("settings")
) {
router.push("/noprojects");
diff --git a/frontend/components/dashboard/DropZone.tsx b/frontend/components/dashboard/DropZone.tsx
index 38e293f4e..ffde34566 100644
--- a/frontend/components/dashboard/DropZone.tsx
+++ b/frontend/components/dashboard/DropZone.tsx
@@ -216,7 +216,7 @@ const DropZone = ({
diff --git a/frontend/components/signup/CodeInputStep.tsx b/frontend/components/signup/CodeInputStep.tsx
new file mode 100644
index 000000000..05c4973a8
--- /dev/null
+++ b/frontend/components/signup/CodeInputStep.tsx
@@ -0,0 +1,136 @@
+import React, { useState } from "react";
+import ReactCodeInput from "react-code-input";
+import { useTranslation } from "next-i18next";
+
+import sendVerificationEmail from "~/pages/api/auth/SendVerificationEmail";
+
+import Button from "../basic/buttons/Button";
+import Error from "../basic/Error";
+
+
+// The style for the verification code input
+const props = {
+ inputStyle: {
+ fontFamily: "monospace",
+ margin: "4px",
+ MozAppearance: "textfield",
+ width: "55px",
+ borderRadius: "5px",
+ fontSize: "24px",
+ height: "55px",
+ paddingLeft: "7",
+ backgroundColor: "#0d1117",
+ color: "white",
+ border: "1px solid #2d2f33",
+ textAlign: "center",
+ outlineColor: "#8ca542",
+ borderColor: "#2d2f33"
+ },
+} as const;
+const propsPhone = {
+ inputStyle: {
+ fontFamily: "monospace",
+ margin: "4px",
+ MozAppearance: "textfield",
+ width: "40px",
+ borderRadius: "5px",
+ fontSize: "24px",
+ height: "40px",
+ paddingLeft: "7",
+ backgroundColor: "#0d1117",
+ color: "white",
+ border: "1px solid #2d2f33",
+ textAlign: "center",
+ outlineColor: "#8ca542",
+ borderColor: "#2d2f33"
+ },
+} as const;
+
+interface CodeInputStepProps {
+ email: string;
+ incrementStep: () => void;
+ setCode: (value: string) => void;
+ codeError: boolean;
+}
+
+/**
+ * This is the second step of sign up where users need to verify their email
+ * @param {object} obj
+ * @param {string} obj.email - user's email to which we just sent a verification email
+ * @param {function} obj.incrementStep - goes to the next step of signup
+ * @param {function} obj.setCode - state updating function that set the current value of the emai verification code
+ * @param {boolean} obj.codeError - whether the code was inputted wrong or now
+ * @returns
+ */
+export default function CodeInputStep({ email, incrementStep, setCode, codeError }: CodeInputStepProps): JSX.Element {
+ const [isLoading, setIsLoading] = useState(false);
+ const [isResendingVerificationEmail, setIsResendingVerificationEmail] =
+ useState(false);
+ const { t } = useTranslation();
+
+ const resendVerificationEmail = async () => {
+ setIsResendingVerificationEmail(true);
+ setIsLoading(true);
+ sendVerificationEmail(email);
+ setTimeout(() => {
+ setIsLoading(false);
+ setIsResendingVerificationEmail(false);
+ }, 2000);
+ };
+
+ return (
+
+
+ {"We've"} sent a verification email to{" "}
+
+
+ {email}{" "}
+
+
+
+
+
+
+
+ {codeError &&
}
+
+
+
+
+
+
+ Not seeing an email?
+
+
+
+ {isResendingVerificationEmail ? "Resending..." : "Resend"}
+
+
+
+
+ {t("signup:step2-spam-alert")}
+
+
+
+ );
+}
diff --git a/frontend/components/signup/DonwloadBackupPDFStep.tsx b/frontend/components/signup/DonwloadBackupPDFStep.tsx
new file mode 100644
index 000000000..786c49fd2
--- /dev/null
+++ b/frontend/components/signup/DonwloadBackupPDFStep.tsx
@@ -0,0 +1,60 @@
+import React from "react";
+import { useTranslation } from "next-i18next";
+import { faWarning } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+import Button from "../basic/buttons/Button";
+import issueBackupKey from "../utilities/cryptography/issueBackupKey";
+
+
+interface DownloadBackupPDFStepProps {
+ incrementStep: () => void;
+ email: string;
+ password: string;
+ name: string;
+}
+
+/**
+ * This is the step of the signup flow where the user downloads the backup pdf
+ * @param {object} obj
+ * @param {function} obj.incrementStep - function that moves the user on to the next stage of signup
+ * @param {string} obj.email - user's email
+ * @param {string} obj.password - user's password
+ * @param {string} obj.name - user's name
+ * @returns
+ */
+export default function DonwloadBackupPDFStep({ incrementStep, email, password, name }: DownloadBackupPDFStepProps): JSX.Element {
+ const { t } = useTranslation();
+
+ return (
+
+
+ {t("signup:step4-message")}
+
+
+
{t("signup:step4-description1")}
+
{t("signup:step4-description2")}
+
+
+
+ {t("signup:step4-description3")}
+
+
+ {
+ await issueBackupKey({
+ email,
+ password,
+ personalName: name,
+ setBackupKeyError: (value: boolean) => {},
+ setBackupKeyIssued: (value: boolean) => {},
+ });
+ incrementStep();
+ }}
+ size="lg"
+ />
+
+
+ );
+}
diff --git a/frontend/components/signup/EnterEmailStep.tsx b/frontend/components/signup/EnterEmailStep.tsx
new file mode 100644
index 000000000..5f98710b7
--- /dev/null
+++ b/frontend/components/signup/EnterEmailStep.tsx
@@ -0,0 +1,97 @@
+import React, { useState } from "react";
+import Link from "next/link";
+import { useTranslation } from "next-i18next";
+
+import sendVerificationEmail from "~/pages/api/auth/SendVerificationEmail";
+
+import Button from "../basic/buttons/Button";
+import InputField from "../basic/InputField";
+
+
+interface DownloadBackupPDFStepProps {
+ incrementStep: () => void;
+ email: string;
+ setEmail: (value: string) => void;
+}
+
+/**
+ * This is the first step of the sign up process - users need to enter their email
+ * @param {object} obj
+ * @param {string} obj.email - email of a user signing up
+ * @param {function} obj.setEmail - funciton that manages the state of the email variable
+ * @param {function} obj.incrementStep - function to go to the next step of the signup flow
+ * @returns
+ */
+export default function EnterEmailStep({ email, setEmail, incrementStep }: DownloadBackupPDFStepProps): JSX.Element {
+ const [emailError, setEmailError] = useState(false);
+ const [emailErrorMessage, setEmailErrorMessage] = useState("");
+ const { t } = useTranslation();
+
+ /**
+ * Verifies if the entered email "looks" correct
+ */
+ const emailCheck = () => {
+ let emailCheckBool = false;
+ if (!email) {
+ setEmailError(true);
+ setEmailErrorMessage("Please enter your email.");
+ emailCheckBool = true;
+ } else if (
+ !email.includes("@") ||
+ !email.includes(".") ||
+ !/[a-z]/.test(email)
+ ) {
+ setEmailError(true);
+ setEmailErrorMessage("Please enter a valid email.");
+ emailCheckBool = true;
+ } else {
+ setEmailError(false);
+ }
+
+ // If everything is correct, go to the next step
+ if (!emailCheckBool) {
+ sendVerificationEmail(email);
+ incrementStep();
+ }
+ };
+
+ return (
+
+
+
+ {'Let\''}s get started
+
+
+
+
+
+
+ {t("signup:step1-privacy")}
+
+
+
+
+
+
+
+
+
+
+ {t("signup:already-have-account")}
+
+
+
+
+
+ );
+}
diff --git a/frontend/components/signup/TeamInviteStep.tsx b/frontend/components/signup/TeamInviteStep.tsx
new file mode 100644
index 000000000..e2639b88f
--- /dev/null
+++ b/frontend/components/signup/TeamInviteStep.tsx
@@ -0,0 +1,72 @@
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import { useTranslation } from "next-i18next";
+
+import addUserToOrg from "~/pages/api/organization/addUserToOrg";
+import getWorkspaces from "~/pages/api/workspace/getWorkspaces";
+
+import Button from "../basic/buttons/Button";
+
+
+/**
+ * This is the last step of the signup flow. People can optionally invite their teammates here.
+ */
+export default function TeamInviteStep(): JSX.Element {
+ const [emails, setEmails] = useState("");
+ const { t } = useTranslation();
+ const router = useRouter();
+
+ // Redirect user to the getting started page
+ const redirectToHome = async () => {
+ const userWorkspaces = await getWorkspaces();
+ const userWorkspace = userWorkspaces[0]._id;
+ router.push("/home/" + userWorkspace);
+
+ }
+
+ const inviteUsers = async ({ emails }: { emails: string; }) => {
+ emails
+ .split(',')
+ .map(email => email.trim())
+ .map(async (email) => await addUserToOrg(email, String(localStorage.getItem('orgData.id'))));
+
+ await redirectToHome();
+ }
+
+ return (
+
+
+ {t("signup:step5-invite-team")}
+
+
+ {t("signup:step5-subtitle")}
+
+
+
+
+ {t("signup:step5-skip")}
+
+
inviteUsers({ emails})}
+ size="lg"
+ />
+
+
+ );
+}
diff --git a/frontend/components/signup/UserInfoStep.tsx b/frontend/components/signup/UserInfoStep.tsx
new file mode 100644
index 000000000..2732f8649
--- /dev/null
+++ b/frontend/components/signup/UserInfoStep.tsx
@@ -0,0 +1,306 @@
+import React, { useState } from "react";
+import { useRouter } from "next/router";
+import { useTranslation } from "next-i18next";
+import { faCheck, faX } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+
+import completeAccountInformationSignup from "~/pages/api/auth/CompleteAccountInformationSignup";
+
+import Button from "../basic/buttons/Button";
+import InputField from "../basic/InputField";
+import attemptLogin from "../utilities/attemptLogin";
+import passwordCheck from "../utilities/checks/PasswordCheck";
+import Aes256Gcm from "../utilities/cryptography/aes-256-gcm";
+
+const nacl = require("tweetnacl");
+const jsrp = require("jsrp");
+nacl.util = require("tweetnacl-util");
+const client = new jsrp.client();
+
+interface UserInfoStepProps {
+ verificationToken: string;
+ incrementStep: () => void;
+ email: string;
+ password: string;
+ setPassword: (value: string) => void;
+ firstName: string;
+ setFirstName: (value: string) => void;
+ lastName: string;
+ setLastName: (value: string) => void;
+}
+
+/**
+ * This is the step of the sign up flow where people provife their name/surname and password
+ * @param {object} obj
+ * @param {string} obj.verificationToken - the token which we use to verify the legitness of a user
+ * @param {string} obj.incrementStep - a function to move to the next signup step
+ * @param {string} obj.email - email of a user who is signing up
+ * @param {string} obj.password - user's password
+ * @param {string} obj.setPassword - function managing the state of user's password
+ * @param {string} obj.firstName - user's first name
+ * @param {string} obj.setFirstName - function managing the state of user's first name
+ * @param {string} obj.lastName - user's lastName
+ * @param {string} obj.setLastName - function managing the state of user's last name
+ */
+export default function UserInfoStep({
+ verificationToken,
+ incrementStep,
+ email,
+ password,
+ setPassword,
+ firstName,
+ setFirstName,
+ lastName,
+ setLastName
+}: UserInfoStepProps): JSX.Element {
+ const [firstNameError, setFirstNameError] = useState(false);
+ const [lastNameError, setLastNameError] = useState(false);
+ const [passwordErrorLength, setPasswordErrorLength] = useState(false);
+ const [passwordErrorNumber, setPasswordErrorNumber] = useState(false);
+ const [passwordErrorLowerCase, setPasswordErrorLowerCase] = useState(false);
+
+ const [isLoading, setIsLoading] = useState(false);
+ const { t } = useTranslation();
+ const router = useRouter();
+
+ // Verifies if the information that the users entered (name, workspace)
+ // is there, and if the password matches the criteria.
+ const signupErrorCheck = async () => {
+ setIsLoading(true);
+ let errorCheck = false;
+ if (!firstName) {
+ setFirstNameError(true);
+ errorCheck = true;
+ } else {
+ setFirstNameError(false);
+ }
+ if (!lastName) {
+ setLastNameError(true);
+ errorCheck = true;
+ } else {
+ setLastNameError(false);
+ }
+ errorCheck = passwordCheck({
+ password,
+ setPasswordErrorLength,
+ setPasswordErrorNumber,
+ setPasswordErrorLowerCase,
+ currentErrorCheck: errorCheck,
+ });
+
+ if (!errorCheck) {
+ // Generate a random pair of a public and a private key
+ const pair = nacl.box.keyPair();
+ const secretKeyUint8Array = pair.secretKey;
+ const publicKeyUint8Array = pair.publicKey;
+ const PRIVATE_KEY = nacl.util.encodeBase64(secretKeyUint8Array);
+ const PUBLIC_KEY = nacl.util.encodeBase64(publicKeyUint8Array);
+
+ const { ciphertext, iv, tag } = Aes256Gcm.encrypt({
+ text: PRIVATE_KEY,
+ secret: password
+ .slice(0, 32)
+ .padStart(
+ 32 + (password.slice(0, 32).length - new Blob([password]).size),
+ "0"
+ ),
+ }) as { ciphertext: string; iv: string; tag: string };
+
+ localStorage.setItem("PRIVATE_KEY", PRIVATE_KEY);
+
+ client.init(
+ {
+ username: email,
+ password: password,
+ },
+ async () => {
+ client.createVerifier(
+ async (err: any, result: { salt: string; verifier: string }) => {
+ const response = await completeAccountInformationSignup({
+ email,
+ firstName,
+ lastName,
+ organizationName: firstName + "'s organization",
+ publicKey: PUBLIC_KEY,
+ ciphertext,
+ iv,
+ tag,
+ salt: result.salt,
+ verifier: result.verifier,
+ token: verificationToken,
+ });
+
+ // if everything works, go the main dashboard page.
+ if (response.status === 200) {
+ // response = await response.json();
+
+ localStorage.setItem("publicKey", PUBLIC_KEY);
+ localStorage.setItem("encryptedPrivateKey", ciphertext);
+ localStorage.setItem("iv", iv);
+ localStorage.setItem("tag", tag);
+
+ try {
+ await attemptLogin(
+ email,
+ password,
+ (value: boolean) => {},
+ router,
+ true,
+ false
+ );
+ incrementStep();
+ } catch (error) {
+ setIsLoading(false);
+ }
+ }
+ }
+ );
+ }
+ );
+ } else {
+ setIsLoading(false);
+ }
+ };
+
+ return (
+
+
+ {t("signup:step3-message")}
+
+
+
+
+
+
+
+
+
{
+ 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 ? (
+
+
+ {t("section-password:validate-base")}
+
+
+ {passwordErrorLength ? (
+
+ ) : (
+
+ )}
+
+ {t("section-password:validate-length")}
+
+
+
+ {passwordErrorLowerCase ? (
+
+ ) : (
+
+ )}
+
+ {t("section-password:validate-case")}
+
+
+
+ {passwordErrorNumber ? (
+
+ ) : (
+
+ )}
+
+ {t("section-password:validate-number")}
+
+
+
+ ) : (
+
+ )}
+
+
+
+
+
+ )
+}
diff --git a/frontend/pages/email-not-verified.js b/frontend/pages/email-not-verified.tsx
similarity index 93%
rename from frontend/pages/email-not-verified.js
rename to frontend/pages/email-not-verified.tsx
index 11aec70bd..3c634874a 100644
--- a/frontend/pages/email-not-verified.js
+++ b/frontend/pages/email-not-verified.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import Head from 'next/head';
-export default function Activity() {
+export default function EmailNotFeriviedPage() {
return (
diff --git a/frontend/pages/signup.tsx b/frontend/pages/signup.tsx
index 224a2b102..d7a3960bf 100644
--- a/frontend/pages/signup.tsx
+++ b/frontend/pages/signup.tsx
@@ -1,67 +1,24 @@
import { useEffect, useState } from "react";
-import ReactCodeInput from "react-code-input";
import Head from "next/head";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";
-import { faCheck, faWarning, faX } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import Button from "~/components/basic/buttons/Button";
-import Error from "~/components/basic/Error";
-import InputField from "~/components/basic/InputField";
-import Aes256Gcm from "~/components/utilities/cryptography/aes-256-gcm";
-import issueBackupKey from "~/components/utilities/cryptography/issueBackupKey";
+import CodeInputStep from "~/components/signup/CodeInputStep";
+import DownloadBackupPDF from "~/components/signup/DonwloadBackupPDFStep";
+import EnterEmailStep from "~/components/signup/EnterEmailStep";
+import TeamInviteStep from "~/components/signup/TeamInviteStep";
+import UserInfoStep from "~/components/signup/UserInfoStep";
import { getTranslatedStaticProps } from "~/components/utilities/withTranslateProps";
-import attemptLogin from "~/utilities/attemptLogin";
-import passwordCheck from "~/utilities/checks/PasswordCheck";
import checkEmailVerificationCode from "./api/auth/CheckEmailVerificationCode";
-import completeAccountInformationSignup from "./api/auth/CompleteAccountInformationSignup";
-import sendVerificationEmail from "./api/auth/SendVerificationEmail";
import getWorkspaces from "./api/workspace/getWorkspaces";
-// const ReactCodeInput = dynamic(import("react-code-input"));
-const nacl = require("tweetnacl");
-const jsrp = require("jsrp");
-nacl.util = require("tweetnacl-util");
-const client = new jsrp.client();
-
-// The stye for the verification code input
-const props = {
- inputStyle: {
- fontFamily: "monospace",
- margin: "4px",
- MozAppearance: "textfield",
- width: "55px",
- borderRadius: "5px",
- fontSize: "24px",
- height: "55px",
- paddingLeft: "7",
- backgroundColor: "#0d1117",
- color: "white",
- border: "1px solid gray",
- textAlign: "center",
- },
-} as const;
-const propsPhone = {
- inputStyle: {
- fontFamily: "monospace",
- margin: "4px",
- MozAppearance: "textfield",
- width: "40px",
- borderRadius: "5px",
- fontSize: "24px",
- height: "40px",
- paddingLeft: "7",
- backgroundColor: "#0d1117",
- color: "white",
- border: "1px solid gray",
- textAlign: "center",
- },
-} as const;
+/**
+ * @returns the signup page
+ */
export default function SignUp() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
@@ -69,25 +26,9 @@ export default function SignUp() {
const [lastName, setLastName] = useState("");
const [code, setCode] = useState("");
const [codeError, setCodeError] = useState(false);
- const [firstNameError, setFirstNameError] = useState(false);
- const [lastNameError, setLastNameError] = useState(false);
- const [passwordErrorLength, setPasswordErrorLength] = useState(false);
- const [passwordErrorNumber, setPasswordErrorNumber] = useState(false);
- const [passwordErrorUpperCase, setPasswordErrorUpperCase] = useState(false);
- const [passwordErrorLowerCase, setPasswordErrorLowerCase] = useState(false);
- const [passwordErrorSpecialChar, setPasswordErrorSpecialChar] =
- useState(false);
- const [emailError, setEmailError] = useState(false);
- const [emailErrorMessage, setEmailErrorMessage] = useState("");
const [step, setStep] = useState(1);
const router = useRouter();
- const [errorLogin, setErrorLogin] = useState(false);
- const [isLoading, setIsLoading] = useState(false);
- const [isResendingVerificationEmail, setIsResendingVerificationEmail] =
- useState(false);
- const [backupKeyError, setBackupKeyError] = useState(false);
const [verificationToken, setVerificationToken] = useState("");
- const [backupKeyIssued, setBackupKeyIssued] = useState(false);
const { t } = useTranslation();
@@ -104,458 +45,28 @@ export default function SignUp() {
}, []);
/**
- * Goes to the following step (out of 3) of the signup process.
+ * Goes to the following step (out of 5) of the signup process.
* Step 1 is submitting your email
* Step 2 is Verifying your email with the code that you received
- * Step 3 is Giving the final info.
+ * Step 3 is asking the final info.
+ * Step 4 is downloading a backup pdf
+ * Step 5 is inviting users
*/
const incrementStep = async () => {
- if (step == 1) {
- setStep(2);
+ if (step == 1 || step == 3 || step == 4) {
+ setStep(step + 1);
} else if (step == 2) {
// Checking if the code matches the email.
const response = await checkEmailVerificationCode({ email, code });
- if (response.status === 200 || code == "111222") {
+ if (response.status === 200) {
setVerificationToken((await response.json()).token);
setStep(3);
} else {
setCodeError(true);
}
- } else if (step == 3) {
- setStep(4);
}
};
- /**
- * Verifies if the entered email "looks" correct
- */
- const emailCheck = () => {
- let emailCheckBool = false;
- if (!email) {
- setEmailError(true);
- setEmailErrorMessage("Please enter your email.");
- emailCheckBool = true;
- } else if (
- !email.includes("@") ||
- !email.includes(".") ||
- !/[a-z]/.test(email)
- ) {
- setEmailError(true);
- setEmailErrorMessage("Please enter a valid email.");
- emailCheckBool = true;
- } else {
- setEmailError(false);
- }
-
- // If everything is correct, go to the next step
- if (!emailCheckBool) {
- sendVerificationEmail(email);
- incrementStep();
- }
- };
-
- // 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;
- if (!firstName) {
- setFirstNameError(true);
- errorCheck = true;
- } else {
- setFirstNameError(false);
- }
- if (!lastName) {
- setLastNameError(true);
- errorCheck = true;
- } else {
- setLastNameError(false);
- }
- errorCheck = passwordCheck({
- password,
- setPasswordErrorLength,
- setPasswordErrorNumber,
- setPasswordErrorLowerCase,
- currentErrorCheck: errorCheck,
- });
-
- if (!errorCheck) {
- // Generate a random pair of a public and a private key
- const pair = nacl.box.keyPair();
- const secretKeyUint8Array = pair.secretKey;
- const publicKeyUint8Array = pair.publicKey;
- const PRIVATE_KEY = nacl.util.encodeBase64(secretKeyUint8Array);
- const PUBLIC_KEY = nacl.util.encodeBase64(publicKeyUint8Array);
-
- const { ciphertext, iv, tag } = Aes256Gcm.encrypt({
- text: PRIVATE_KEY,
- secret: password
- .slice(0, 32)
- .padStart(
- 32 + (password.slice(0, 32).length - new Blob([password]).size),
- "0"
- ),
- }) as { ciphertext: string; iv: string; tag: string };
-
- localStorage.setItem("PRIVATE_KEY", PRIVATE_KEY);
-
- client.init(
- {
- username: email,
- password: password,
- },
- async () => {
- client.createVerifier(
- async (err: any, result: { salt: string; verifier: string }) => {
- const response = await completeAccountInformationSignup({
- email,
- firstName,
- lastName,
- organizationName: firstName + "'s organization",
- publicKey: PUBLIC_KEY,
- ciphertext,
- iv,
- tag,
- salt: result.salt,
- verifier: result.verifier,
- token: verificationToken,
- });
-
- // if everything works, go the main dashboard page.
- if (response.status === 200) {
- // response = await response.json();
-
- localStorage.setItem("publicKey", PUBLIC_KEY);
- localStorage.setItem("encryptedPrivateKey", ciphertext);
- localStorage.setItem("iv", iv);
- localStorage.setItem("tag", tag);
-
- try {
- await attemptLogin(
- email,
- password,
- setErrorLogin,
- router,
- true,
- false
- );
- incrementStep();
- } catch (error) {
- setIsLoading(false);
- }
- }
- }
- );
- }
- );
- } else {
- setIsLoading(false);
- }
- };
-
- const resendVerificationEmail = async () => {
- setIsResendingVerificationEmail(true);
- setIsLoading(true);
- await sendVerificationEmail(email);
- setTimeout(() => {
- setIsLoading(false);
- setIsResendingVerificationEmail(false);
- }, 2000);
- };
-
- // Step 1 of the sign up process (enter the email or choose google authentication)
- const step1 = (
-
-
-
- {'Let\''}s get started
-
-
-
-
- {/*
-
-
I do not want to receive emails about Infisical and its products.
-
*/}
-
-
- {t("signup:step1-privacy")}
-
-
-
-
-
-
-
-
-
-
- {t("signup:already-have-account")}
-
-
-
-
-
-
- );
-
- // Step 2 of the signup process (enter the email verification code)
- const step2 = (
-
-
- {"We've"} sent a verification email to{" "}
-
-
- {email}{" "}
-
-
-
-
-
-
-
- {codeError &&
}
-
-
-
-
-
-
- Not seeing an email?
-
-
-
- {isResendingVerificationEmail ? "Resending..." : "Resend"}
-
-
-
-
- {t("signup:step2-spam-alert")}
-
-
-
- );
-
- // Step 3 of the signup process (enter the rest of the impformation)
- const step3 = (
-
-
- {t("signup:step3-message")}
-
-
-
-
-
-
-
-
-
{
- 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 ? (
-
-
- {t("section-password:validate-base")}
-
-
- {passwordErrorLength ? (
-
- ) : (
-
- )}
-
- {t("section-password:validate-length")}
-
-
-
- {passwordErrorLowerCase ? (
-
- ) : (
-
- )}
-
- {t("section-password:validate-case")}
-
-
-
- {passwordErrorNumber ? (
-
- ) : (
-
- )}
-
- {t("section-password:validate-number")}
-
-
-
- ) : (
-
- )}
-
-
-
-
-
- );
-
- // Step 4 of the sign up process (download the emergency kit pdf)
- const step4 = (
-
-
- {t("signup:step4-message")}
-
-
-
{t("signup:step4-description1")}
-
{t("signup:step4-description2")}
-
-
-
- {t("signup:step4-description3")}
-
-
-
{
- await issueBackupKey({
- email,
- password,
- personalName: firstName + " " + lastName,
- setBackupKeyError,
- setBackupKeyIssued,
- });
- const userWorkspaces = await getWorkspaces();
- const userWorkspace = userWorkspaces[0]._id;
- router.push("/home/" + userWorkspace);
- }}
- size="lg"
- />
- {/* {
- if (localStorage.getItem("projectData.id")) {
- router.push("/dashboard/" + localStorage.getItem("projectData.id"));
- } else {
- router.push("/noprojects")
- }
- }}
- >
- Later
-
*/}
-
-
- );
-
return (
@@ -580,7 +91,11 @@ export default function SignUp() {
diff --git a/frontend/pages/signupinvite.js b/frontend/pages/signupinvite.js
index d32d6038d..58a15e40d 100644
--- a/frontend/pages/signupinvite.js
+++ b/frontend/pages/signupinvite.js
@@ -349,7 +349,7 @@ export default function SignupInvite() {
setBackupKeyError,
setBackupKeyIssued
});
- router.push('/dashboard/');
+ router.push('/noprojects/');
}}
size="lg"
/>
diff --git a/frontend/public/locales/en/common.json b/frontend/public/locales/en/common.json
index c0b1e5640..34cdcaea8 100644
--- a/frontend/public/locales/en/common.json
+++ b/frontend/public/locales/en/common.json
@@ -13,8 +13,8 @@
"project-id": "Project ID",
"save-changes": "Save Changes",
"saved": "Saved",
- "drop-zone": "Drag and drop your .env file here.",
- "drop-zone-keys": "Drag and drop your .env file here to add more keys.",
+ "drop-zone": "Drag and drop a .env or .yml file here.",
+ "drop-zone-keys": "Drag and drop a .env or .yml file here to add more keys.",
"role": "Role",
"role_admin": "admin",
"display-name": "Display Name",
diff --git a/frontend/public/locales/en/dashboard.json b/frontend/public/locales/en/dashboard.json
index 99e6d9faa..263887360 100644
--- a/frontend/public/locales/en/dashboard.json
+++ b/frontend/public/locales/en/dashboard.json
@@ -10,6 +10,7 @@
"shared-description": "Shared keys are visible to your whole team",
"make-shared": "Make Shared",
"make-personal": "Make Personal",
+ "add-secret": "Add a new secret",
"check-docs": {
"button": "Check Docs",
"title": "Good job!",
diff --git a/frontend/public/locales/en/signup.json b/frontend/public/locales/en/signup.json
index 509520d56..0fbc92951 100644
--- a/frontend/public/locales/en/signup.json
+++ b/frontend/public/locales/en/signup.json
@@ -17,5 +17,9 @@
"step4-description1": "If you get locked out of your account, your Emergency Kit is the only way to sign in.",
"step4-description2": "We recommend you download it and keep it somewhere safe.",
"step4-description3": "It contains your Secret Key which we cannot access or recover for you if you lose it.",
- "step4-download": "Download PDF"
+ "step4-download": "Download PDF",
+ "step5-send-invites": "Send Invites",
+ "step5-invite-team": "Invite your team",
+ "step5-subtitle": "Infisical is meant to be used with your teammates. Invite them to test it out.",
+ "step5-skip": "Skip"
}