File tree 3 files changed +15
-3
lines changed
3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,8 @@ export default {
319
319
} ,
320
320
passwordForm : {
321
321
pleaseFillOutAllFields : 'Please fill out all fields' ,
322
+ pleaseFillPassword : 'Please enter your password' ,
323
+ pleaseFillTwoFactorAuth : 'Please enter your two factor code' ,
322
324
enterYourTwoFactorAuthenticationCodeToContinue : 'Enter your two factor authentication code to continue' ,
323
325
forgot : 'Forgot?' ,
324
326
twoFactorCode : 'Two factor code' ,
Original file line number Diff line number Diff line change @@ -319,6 +319,8 @@ export default {
319
319
} ,
320
320
passwordForm : {
321
321
pleaseFillOutAllFields : 'Por favor completa todos los campos' ,
322
+ pleaseFillPassword : 'Por favor, introduce tu contraseña' ,
323
+ pleaseFillTwoFactorAuth : 'Por favor, introduce tu código 2 factores' ,
322
324
enterYourTwoFactorAuthenticationCodeToContinue : 'Ingrese su código de autenticación de dos factores para continuar' ,
323
325
forgot : '¿Te has olvidado?' ,
324
326
twoFactorCode : 'Autenticación de 2 factores' ,
Original file line number Diff line number Diff line change @@ -56,13 +56,21 @@ class PasswordForm extends React.Component {
56
56
* Check that all the form fields are valid, then trigger the submit callback
57
57
*/
58
58
validateAndSubmitForm ( ) {
59
- if ( ! this . state . password . trim ( )
60
- || ( this . props . account . requiresTwoFactorAuth && ! this . state . twoFactorAuthCode . trim ( ) )
61
- ) {
59
+ if ( ! this . state . password . trim ( ) && this . props . account . requiresTwoFactorAuth && ! this . state . twoFactorAuthCode . trim ( ) ) {
62
60
this . setState ( { formError : 'passwordForm.pleaseFillOutAllFields' } ) ;
63
61
return ;
64
62
}
65
63
64
+ if ( ! this . state . password . trim ( ) ) {
65
+ this . setState ( { formError : 'passwordForm.pleaseFillPassword' } ) ;
66
+ return ;
67
+ }
68
+
69
+ if ( this . props . account . requiresTwoFactorAuth && ! this . state . twoFactorAuthCode . trim ( ) ) {
70
+ this . setState ( { formError : 'passwordForm.pleaseFillTwoFactorAuth' } ) ;
71
+ return ;
72
+ }
73
+
66
74
this . setState ( {
67
75
formError : null ,
68
76
} ) ;
You can’t perform that action at this time.
0 commit comments