Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: check email should be lowercase #1457

Closed
wants to merge 15 commits into from
8 changes: 7 additions & 1 deletion client/src/pages/CheckInForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ const CheckInForm = (props) => {
setErrorMessage(error);
setIsLoading(false);
}
// }
};

const submitNewProfile = (userForm) => {
Expand Down Expand Up @@ -304,6 +303,11 @@ const CheckInForm = (props) => {
setErrorMessage("Please don't leave any fields blank");
ready = false;
}
if (userForm.email !== userForm.email.toLowerCase()) {
setIsError(true)
setErrorMessage("Email should be lowercase.");
ready = false;
}

const currYear = parseInt(moment().format('YYYY'));
const currMonth = parseInt(moment().format('MM'));
Expand Down Expand Up @@ -402,6 +406,8 @@ const CheckInForm = (props) => {
try {
if (!formInput.email) {
throw new Error('User email is required');
} else if (formInput.email !== formInput.email.toLowerCase()) {
throw new Error('User email must be lowercase');
}

setIsLoading(true);
Expand Down