51 lines
765 B
TypeScript
51 lines
765 B
TypeScript
import { BaseRequest } from './base';
|
|
import {
|
|
IsBoolean,
|
|
IsEmail,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString
|
|
} from 'class-validator';
|
|
|
|
export class SignUpRequest extends BaseRequest {
|
|
@IsEmail()
|
|
username: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
password: string;
|
|
}
|
|
|
|
export class LoginRequest extends SignUpRequest {
|
|
@IsOptional()
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
otp?: string;
|
|
}
|
|
|
|
export class TfaSetup extends BaseRequest {
|
|
@IsNotEmpty()
|
|
@IsBoolean()
|
|
mail: boolean;
|
|
}
|
|
|
|
export class TfaComplete extends BaseRequest {
|
|
@IsNotEmpty()
|
|
@IsBoolean()
|
|
mail: boolean;
|
|
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
code: string;
|
|
}
|
|
|
|
export class ChangePasswordRequest extends BaseRequest {
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
oldPassword: string;
|
|
|
|
@IsNotEmpty()
|
|
@IsString()
|
|
newPassword: string;
|
|
}
|