This commit is contained in:
Kiss Dávid
2025-07-18 10:27:33 +02:00
commit 590adb271d
40 changed files with 8792 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import vine from '@vinejs/vine'
const password = vine.string().minLength(8)
export const registerValidator = vine.compile(
vine.object({
email: vine
.string()
.email()
.normalizeEmail()
.unique(async (db, value) => {
const match = await db.from('users').select('id').where('email', value).first()
return !match
}),
password,
})
)
export const loginValidator = vine.compile(
vine.object({
email: vine.string().email().normalizeEmail(),
password,
})
)