tethys.backend/app/validators/auth.ts
Arno Kaimbacher ec17d79cf2
Some checks failed
CI Pipeline / japa-tests (push) Failing after 56s
- replaced validation library @adonisjs/validator with @vinejs/vine (performance)
- npm updates
2024-05-16 13:47:06 +02:00

21 lines
560 B
TypeScript

import vine from '@vinejs/vine';
// public schema = schema.create({
// email: schema.string({ trim: true }, [
// rules.email(),
// // rules.unique({ table: 'accounts', column: 'email' })
// ]),
// password: schema.string({}, [rules.minLength(6)]),
// });
/**
* Validates the role's creation action
* node ace make:validator role
*/
export const authValidator = vine.compile(
vine.object({
email: vine.string().maxLength(255).email().normalizeEmail(),
password: vine.string().trim().minLength(6),
}),
);