Complain if they log in with email

This commit is contained in:
Tanner Collin 2020-02-16 07:39:36 +00:00
parent a757534061
commit f88256eb74

View File

@ -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 (