diff --git a/frontend/src/components/login/InitialLoginStep.tsx b/frontend/src/components/login/InitialLoginStep.tsx index bcce19d1c..72e375482 100644 --- a/frontend/src/components/login/InitialLoginStep.tsx +++ b/frontend/src/components/login/InitialLoginStep.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { FormEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -31,7 +31,8 @@ export default function InitialLoginStep({ const [isLoading, setIsLoading] = useState(false); const [loginError, setLoginError] = useState(false); - const handleLogin = async () => { + const handleLogin = async (e: FormEvent) => { + e.preventDefault() try { if (!email || !password) { return; @@ -98,7 +99,7 @@ export default function InitialLoginStep({ setIsLoading(false); } - return
+ return

Login to Infisical

{/*
-
+ } diff --git a/frontend/src/components/signup/CodeInputStep.tsx b/frontend/src/components/signup/CodeInputStep.tsx index dd765c1fc..7f6c75871 100644 --- a/frontend/src/components/signup/CodeInputStep.tsx +++ b/frontend/src/components/signup/CodeInputStep.tsx @@ -114,6 +114,7 @@ export default function CodeInputStep({
@@ -301,6 +300,7 @@ export default function UserInfoStep({
-
+ ); // Enter new password const stepEnterNewPassword = ( -
+

Enter new password

@@ -269,13 +274,15 @@ export default function PasswordReset() {
-
+ ); return ( diff --git a/frontend/src/pages/verify-email.tsx b/frontend/src/pages/verify-email.tsx index 33640dbc1..605c71da8 100644 --- a/frontend/src/pages/verify-email.tsx +++ b/frontend/src/pages/verify-email.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { FormEvent, useState } from "react"; import Head from "next/head"; import Image from "next/image"; import Link from "next/link"; @@ -12,6 +12,7 @@ import { useFetchServerStatus } from "@app/hooks/api/serverDetails"; import SendEmailOnPasswordReset from "./api/auth/SendEmailOnPasswordReset"; export default function VerifyEmail() { + const [loading, setLoading] = useState(false); const [email, setEmail] = useState(""); const [step, setStep] = useState(1); const { data: serverDetails } = useFetchServerStatus(); @@ -27,6 +28,18 @@ export default function VerifyEmail() { } }; + const onSubmit = (e: FormEvent) => { + e.preventDefault(); + setLoading(true); + + if (serverDetails?.emailConfigured) { + sendVerificationEmail(); + } else { + handlePopUpOpen("setUpEmail"); + setLoading(false); + } + }; + return (
@@ -45,7 +58,7 @@ export default function VerifyEmail() {
{step === 1 && ( -
+

Forgot your password?

@@ -67,20 +80,10 @@ export default function VerifyEmail() {
-
- + )} {step === 2 && (