2022-08-25 11:39:58 +00:00
|
|
|
import { BaseRequest } from './base';
|
2022-08-25 13:13:44 +00:00
|
|
|
import {
|
|
|
|
IsBoolean,
|
|
|
|
IsEmail,
|
|
|
|
IsNotEmpty,
|
|
|
|
IsOptional,
|
|
|
|
IsString
|
|
|
|
} from 'class-validator';
|
2022-08-25 11:39:58 +00:00
|
|
|
|
2022-08-25 13:13:44 +00:00
|
|
|
export class SignUpRequest extends BaseRequest {
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsEmail()
|
|
|
|
username: string;
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-08-25 13:13:44 +00:00
|
|
|
@IsString()
|
2022-08-25 11:39:58 +00:00
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
2022-08-25 13:13:44 +00:00
|
|
|
export class LoginRequest extends SignUpRequest {
|
|
|
|
@IsOptional()
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsString()
|
2022-08-25 11:39:58 +00:00
|
|
|
otp?: string;
|
|
|
|
}
|
2022-08-25 13:13:44 +00:00
|
|
|
|
2022-08-25 15:52:23 +00:00
|
|
|
export class TfaSetup extends BaseRequest {
|
2022-08-25 13:13:44 +00:00
|
|
|
@IsNotEmpty()
|
2022-08-25 15:52:23 +00:00
|
|
|
@IsBoolean()
|
|
|
|
mail: boolean;
|
2022-08-25 13:13:44 +00:00
|
|
|
}
|
|
|
|
|
2022-08-25 15:52:23 +00:00
|
|
|
export class TfaComplete extends BaseRequest {
|
2022-08-25 13:13:44 +00:00
|
|
|
@IsNotEmpty()
|
|
|
|
@IsBoolean()
|
|
|
|
mail: boolean;
|
2022-08-25 15:52:23 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsString()
|
|
|
|
code: string;
|
2022-08-25 13:13:44 +00:00
|
|
|
}
|
2022-08-25 11:27:47 +00:00
|
|
|
|
|
|
|
export class ChangePasswordRequest extends BaseRequest {
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsString()
|
|
|
|
oldPassword: string;
|
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsString()
|
|
|
|
newPassword: string;
|
|
|
|
}
|