Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ export default {
},
passwordForm: {
pleaseFillOutAllFields: 'Please fill out all fields',
pleaseFillPassword: 'Please enter your password',
pleaseFillTwoFactorAuth: 'Please enter your two factor code',
enterYourTwoFactorAuthenticationCodeToContinue: 'Enter your two factor authentication code to continue',
forgot: 'Forgot?',
twoFactorCode: 'Two factor code',
Expand Down
2 changes: 2 additions & 0 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ export default {
},
passwordForm: {
pleaseFillOutAllFields: 'Por favor completa todos los campos',
pleaseFillPassword: 'Por favor, introduce tu contraseña',
pleaseFillTwoFactorAuth: 'Por favor, introduce tu código 2 factores',
enterYourTwoFactorAuthenticationCodeToContinue: 'Ingrese su código de autenticación de dos factores para continuar',
forgot: '¿Te has olvidado?',
twoFactorCode: 'Autenticación de 2 factores',
Expand Down
14 changes: 11 additions & 3 deletions src/pages/signin/PasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,21 @@ class PasswordForm extends React.Component {
* Check that all the form fields are valid, then trigger the submit callback
*/
validateAndSubmitForm() {
if (!this.state.password.trim()
|| (this.props.account.requiresTwoFactorAuth && !this.state.twoFactorAuthCode.trim())
) {
if (!this.state.password.trim() && this.props.account.requiresTwoFactorAuth && !this.state.twoFactorAuthCode.trim()) {
this.setState({formError: 'passwordForm.pleaseFillOutAllFields'});
return;
}

if (!this.state.password.trim()) {
Comment thread
puneetlath marked this conversation as resolved.
this.setState({formError: 'passwordForm.pleaseFillPassword'});
return;
}

if (this.props.account.requiresTwoFactorAuth && !this.state.twoFactorAuthCode.trim()) {
this.setState({formError: 'passwordForm.pleaseFillTwoFactorAuth'});
return;
}

this.setState({
formError: null,
});
Expand Down