Commit 5f68cfd0 authored by Oleksii Savran's avatar Oleksii Savran

Login with empty fields should leads to the error message

parent 1f0f072e
......@@ -2061,7 +2061,8 @@
"userName": "Username",
"password": "Password",
"googleLogin": "Login with Google",
"login": "Login"
"login": "Login",
"fillFields": "Please fill in the fields"
},
"registrationForm": {
"password": "Password",
......
......@@ -5,7 +5,8 @@
"userName": "Username",
"password": "Password",
"googleLogin": "Login with Google",
"login": "Login"
"login": "Login",
"fillFields": "Please fill in the fields"
},
"registrationForm": {
"password": "Password",
......
......@@ -39,7 +39,7 @@ class Login extends React.Component<ILoginProps, any> {
}
protected authorize = (e) => {
const { onTryLogin } = this.props;
const { onTryLogin, t } = this.props;
e.preventDefault();
if (this.state.username && this.state.password) {
onTryLogin(this.state.username, this.state.password).then((res) => {
......@@ -47,6 +47,8 @@ class Login extends React.Component<ILoginProps, any> {
this.setState(res);
}
});
} else {
this.setState({...this.state, error: 'empty_field', errorDescription : t('user.public.c.loginForm.fillFields') });
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment