omgebouwd naar adonisjs, werkt nog niet echt goed
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
Reference in New Issue
Block a user