You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lib/src/auth/ui/basic/BasicRegisterFormRequest.ts

26 lines
648 B

import {FormRequest, ValidationRules} from '../../../forms'
import {Is, Str} from '../../../forms/rules/rules'
import {Singleton} from '../../../di'
export interface BasicRegisterFormData {
username: string,
password: string,
}
@Singleton()
export class BasicRegisterFormRequest extends FormRequest<BasicRegisterFormData> {
protected getRules(): ValidationRules {
return {
username: [
Is.required,
Str.lengthMin(1),
],
password: [
Is.required,
Str.lengthMin(1),
Str.confirmed,
],
}
}
}