mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 00:02:37 +10:00
fix(mail regex): removed global flag
This commit is contained in:
@ -382,7 +382,6 @@ import {
|
|||||||
import type { Invitation } from "@prisma/client";
|
import type { Invitation } from "@prisma/client";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import type { SerializeObject } from "nitropack";
|
import type { SerializeObject } from "nitropack";
|
||||||
import LoadingButton from "~/components/LoadingButton.vue";
|
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: "admin",
|
layout: "admin",
|
||||||
@ -434,7 +433,7 @@ const email = computed({
|
|||||||
_email.value = v;
|
_email.value = v;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const mailRegex = /^\S+@\S+\.\S+$/g;
|
const mailRegex = /^\S+@\S+\.\S+$/;
|
||||||
const validEmail = computed(() =>
|
const validEmail = computed(() =>
|
||||||
_email.value === undefined ? true : mailRegex.test(email.value as string)
|
_email.value === undefined ? true : mailRegex.test(email.value as string)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -208,7 +208,7 @@ const username = ref(invitation.data.value?.username);
|
|||||||
const password = ref("");
|
const password = ref("");
|
||||||
const confirmPassword = ref(undefined);
|
const confirmPassword = ref(undefined);
|
||||||
|
|
||||||
const mailRegex = /^\S+@\S+\.\S+$/g;
|
const mailRegex = /^\S+@\S+\.\S+$/;
|
||||||
const validEmail = computed(() => mailRegex.test(email.value ?? ""));
|
const validEmail = computed(() => mailRegex.test(email.value ?? ""));
|
||||||
const validUsername = computed(
|
const validUsername = computed(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { v4 as uuidv4 } from "uuid";
|
|||||||
import * as jdenticon from "jdenticon";
|
import * as jdenticon from "jdenticon";
|
||||||
|
|
||||||
// Only really a simple test, in case people mistype their emails
|
// Only really a simple test, in case people mistype their emails
|
||||||
const mailRegex = /^\S+@\S+\.\S+$/g;
|
const mailRegex = /^\S+@\S+\.\S+$/;
|
||||||
|
|
||||||
export default defineEventHandler(async (h3) => {
|
export default defineEventHandler(async (h3) => {
|
||||||
const body = await readBody(h3);
|
const body = await readBody(h3);
|
||||||
|
|||||||
Reference in New Issue
Block a user