mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-27 02:43:45 +02:00
Login: add general error message, when credentials are wrong
This commit is contained in:
parent
ec1fb466dc
commit
26e62e0f20
@ -14,10 +14,14 @@ const Login = ({handleLogin}) => {
|
||||
const location = useLocation();
|
||||
|
||||
const onSubmit = async data => {
|
||||
const loginAttempt = await user.login(data)
|
||||
if (loginAttempt?.username) {
|
||||
await handleLogin(loginAttempt);
|
||||
history.push('/');
|
||||
try {
|
||||
const loginAttempt = await user.login(data)
|
||||
if (loginAttempt?.username) {
|
||||
await handleLogin(loginAttempt);
|
||||
history.push('/');
|
||||
}
|
||||
} catch (e) {
|
||||
window.flash("Login failed. Username or Password wrong.", "red");
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user