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.
23 lines
642 B
23 lines
642 B
3 years ago
|
import {FormRequest, ValidationRules} from '../../forms'
|
||
|
import {Is, Str} from '../../forms/rules/rules'
|
||
|
import {Singleton} from '../../di'
|
||
|
import {AuthenticatableCredentials} from '../types'
|
||
|
|
||
|
@Singleton()
|
||
|
export class BasicRegisterFormRequest extends FormRequest<AuthenticatableCredentials> {
|
||
|
protected getRules(): ValidationRules {
|
||
|
return {
|
||
|
identifier: [
|
||
|
Is.required,
|
||
|
Str.lengthMin(1),
|
||
|
Str.alphaNum,
|
||
|
],
|
||
|
credential: [
|
||
|
Is.required,
|
||
|
Str.lengthMin(8),
|
||
|
Str.confirmed,
|
||
|
],
|
||
|
}
|
||
|
}
|
||
|
}
|