Implemented default admin account
This commit is contained in:
@@ -49,15 +49,10 @@ const LogIn = props => {
|
||||
);
|
||||
};
|
||||
|
||||
//DOCS: returns two values: response and OK
|
||||
const handleSubmit = async (email, password) => {
|
||||
email = email.trim();
|
||||
|
||||
const err = handleValidation(email, password);
|
||||
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
|
||||
//generate a new formdata payload
|
||||
let formData = new FormData();
|
||||
|
||||
@@ -73,17 +68,4 @@ const handleSubmit = async (email, password) => {
|
||||
}
|
||||
};
|
||||
|
||||
//returns an error message, or null on success
|
||||
const handleValidation = (email, password) => {
|
||||
if (!validateEmail(email)) {
|
||||
return 'invalid email';
|
||||
}
|
||||
|
||||
if (password.length < 8) {
|
||||
return 'invalid password (Must be at least 8 characters long)';
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default LogIn;
|
||||
|
||||
Reference in New Issue
Block a user