Skip to content

Commit

Permalink
Merge pull request #1 from RomuloGatto/fix/email-validation-registration
Browse files Browse the repository at this point in the history
adding email validator
  • Loading branch information
RomuloGatto authored Aug 24, 2024
2 parents 33ee208 + 9dca13e commit 665b3c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@
async function registerUser() {
loading.value = true;
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email.value)) {
toast.error("Invalid email address");
loading.value = false;
return;
}
const { error } = await api.register({
name: username.value,
email: email.value,
Expand Down

0 comments on commit 665b3c1

Please sign in to comment.