Complain if they log in with email
This commit is contained in:
parent
a757534061
commit
f88256eb74
|
@ -13,6 +13,9 @@ export function LoginForm(props) {
|
||||||
const handleChange = (e) => handleValues(e, e.currentTarget);
|
const handleChange = (e) => handleValues(e, e.currentTarget);
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
const handleSubmit = (e) => {
|
||||||
|
if (input.username.includes('@')) {
|
||||||
|
setError({ username: 'Username, not email.' });
|
||||||
|
} else {
|
||||||
if (loading) return;
|
if (loading) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const data = { ...input, username: input.username.toLowerCase() };
|
const data = { ...input, username: input.username.toLowerCase() };
|
||||||
|
@ -27,6 +30,7 @@ export function LoginForm(props) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
setError(err.data);
|
setError(err.data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user