diff --git a/i18n/en.pot b/i18n/en.pot index 32aa8bf..21d9b40 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2025-02-26T10:01:36.204Z\n" -"PO-Revision-Date: 2025-02-26T10:01:36.204Z\n" +"POT-Creation-Date: 2025-03-04T11:41:36.161Z\n" +"PO-Revision-Date: 2025-03-04T11:41:36.161Z\n" msgid "Please confirm that you are not a robot by checking the checkbox." msgstr "Please confirm that you are not a robot by checking the checkbox." @@ -179,6 +179,9 @@ msgstr "Something went wrong" msgid "Incorrect username or password" msgstr "Incorrect username or password" +msgid "Authentication code is required" +msgstr "Authentication code is required" + msgid "Incorrect authentication code" msgstr "Incorrect authentication code" @@ -201,11 +204,11 @@ msgid "Enter the code from your two-factor authentication app to log in." msgstr "Enter the code from your two-factor authentication app to log in." msgid "" -"We have sent you an email with your authentication code, enter it below to " -"log in" +"'We have sent you an email with your authentication code. Enter it below to " +"log in." msgstr "" -"We have sent you an email with your authentication code, enter it below to " -"log in" +"'We have sent you an email with your authentication code. Enter it below to " +"log in." msgid "Username or email" msgstr "Username or email" diff --git a/src/pages/login.js b/src/pages/login.js index 861e309..ea87e9f 100644 --- a/src/pages/login.js +++ b/src/pages/login.js @@ -61,7 +61,7 @@ export const LoginFormContainer = () => {

{i18n.t( - 'We have sent you an email with your authentication code, enter it below to log in', + 'We have sent you an email with your authentication code. Enter it below to log in.', { lngs } )}

diff --git a/src/pages/login/InnerLoginForm.js b/src/pages/login/InnerLoginForm.js index 4bcf001..3541764 100644 --- a/src/pages/login/InnerLoginForm.js +++ b/src/pages/login/InnerLoginForm.js @@ -98,7 +98,12 @@ export const InnerLoginForm = ({ />
- {showResentCode && ( @@ -106,6 +111,7 @@ export const InnerLoginForm = ({ secondary disabled={isResendDisabled || loading} onClick={resendCode} + loading={loading} > {i18n.t('Resend Code', { lngs })} diff --git a/src/pages/login/LoginErrors.js b/src/pages/login/LoginErrors.js index f0f5a9d..7f41bde 100644 --- a/src/pages/login/LoginErrors.js +++ b/src/pages/login/LoginErrors.js @@ -14,6 +14,7 @@ export const LoginErrors = ({ unknownStatus, emailTwoFAIncorrect, isResetButtonPressed, + twoFAError, }) => { if (error) { return ( @@ -38,6 +39,15 @@ export const LoginErrors = ({ ) } + if (twoFAError) { + return ( + + ) + } + if (twoFAIncorrect) { return ( { const [formSubmitted, setFormSubmitted] = useState(false) const [isResetButtonPressed, setIsResetButtonPressed] = useState(false) + const [twoFAError, setTwoFAError] = useState(false) if (!login) { return null @@ -30,10 +31,16 @@ export const LoginForm = ({ const handleLogin = (values) => { setFormSubmitted(true) - - if (!checkIsLoginFormValid(values)) { + if ( + !checkIsLoginFormValid(values) || + (twoFAVerificationRequired && + !values.twoFA && + !isResetButtonPressed) + ) { + setTwoFAError(true) return } + setTwoFAError(false) login({ username: values.username, password: values.password, @@ -53,6 +60,7 @@ export const LoginForm = ({ unknownStatus={unknownStatus} emailTwoFAIncorrect={emailTwoFAIncorrect} isResetButtonPressed={isResetButtonPressed} + twoFAError={twoFAError} />