mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-10 04:22:09 +10:00
fix: register page validation
This commit is contained in:
@ -1,4 +1,9 @@
|
||||
const whitelistedPrefixes = ["/auth/signin", "/register", "/api", "/setup"];
|
||||
const whitelistedPrefixes = [
|
||||
"/auth/signin",
|
||||
"/auth/register",
|
||||
"/api",
|
||||
"/setup",
|
||||
];
|
||||
const requireAdmin = ["/admin"];
|
||||
|
||||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
|
||||
@ -214,7 +214,7 @@ const validEmail = computed(
|
||||
() => !(emailValidator(email.value) instanceof type.errors)
|
||||
);
|
||||
|
||||
const usernameValidator = type("string.lower.preformatted >= 5");
|
||||
const usernameValidator = type("string.alphanumeric >= 5").to("string.lower");
|
||||
const validUsername = computed(
|
||||
() => !(usernameValidator(username.value) instanceof type.errors)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user