Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
fix: ensures the email is always treated as lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien-Torrent committed Aug 24, 2021
1 parent cf86201 commit 0e4d2cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/SignIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class SignIn extends Component {

handleSignIn = async () => {
const { email } = this.state;
const checkingEmail = emailValidator(email);
const checkingEmail = emailValidator(email.toLowerCase());
if (checkingEmail) {
this.setState({ emailError: checkingEmail, error: true });
} else {
await signIn({ email });
await signIn({ email: email.toLowerCase() });
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class SignUp extends Component {

handleRegister = async () => {
const { email, name } = this.state;
const checkingEmail = emailValidator(email);
const checkingEmail = emailValidator(email.toLowerCase());
const checkingUsername = nameValidator(name);
if (checkingEmail || checkingUsername) {
this.setState({
Expand All @@ -111,7 +111,7 @@ class SignUp extends Component {
error: true,
});
} else {
await signUp({ name, email });
await signUp({ name, email: email.toLowerCase() });
}
};

Expand Down

0 comments on commit 0e4d2cd

Please sign in to comment.