omgebouwd naar adonisjs, werkt nog niet echt goed

This commit is contained in:
Daan Meijer
2026-06-03 23:41:09 +02:00
parent dfd3336447
commit 62f1767df3
89 changed files with 9892 additions and 1174 deletions
+26
View File
@@ -0,0 +1,26 @@
import vine from '@vinejs/vine'
/**
* Shared rules for email and password.
*/
const email = () => vine.string().email().maxLength(254)
const password = () => vine.string().minLength(8).maxLength(32)
/**
* Validator to use when performing self-signup
*/
export const signupValidator = vine.create({
fullName: vine.string().nullable(),
email: email().unique({ table: 'users', column: 'email' }),
password: password(),
passwordConfirmation: password().sameAs('password'),
})
/**
* Validator to use before validating user credentials
* during login
*/
export const loginValidator = vine.create({
email: email(),
password: vine.string(),
})