fix(mail regex): removed global flag

This commit is contained in:
DecDuck
2024-12-27 13:14:29 +11:00
parent 61d88c3091
commit 43e32b44a2
3 changed files with 3 additions and 4 deletions

View File

@ -382,7 +382,6 @@ import {
import type { Invitation } from "@prisma/client";
import moment from "moment";
import type { SerializeObject } from "nitropack";
import LoadingButton from "~/components/LoadingButton.vue";
definePageMeta({
layout: "admin",
@ -434,7 +433,7 @@ const email = computed({
_email.value = v;
},
});
const mailRegex = /^\S+@\S+\.\S+$/g;
const mailRegex = /^\S+@\S+\.\S+$/;
const validEmail = computed(() =>
_email.value === undefined ? true : mailRegex.test(email.value as string)
);

View File

@ -208,7 +208,7 @@ const username = ref(invitation.data.value?.username);
const password = ref("");
const confirmPassword = ref(undefined);
const mailRegex = /^\S+@\S+\.\S+$/g;
const mailRegex = /^\S+@\S+\.\S+$/;
const validEmail = computed(() => mailRegex.test(email.value ?? ""));
const validUsername = computed(
() =>