2022-08-24 14:15:33 +00:00
|
|
|
import { BaseResponse, SuccessResponse } from './base';
|
2022-08-25 11:39:58 +00:00
|
|
|
import { IsBase32, IsJWT, IsNotEmpty } from 'class-validator';
|
2022-08-24 14:15:33 +00:00
|
|
|
|
|
|
|
export type TfaRequiredResponse = SuccessResponse;
|
|
|
|
export type RemoveTfaResponse = SuccessResponse;
|
|
|
|
export type RequestEmailTfaResponse = SuccessResponse;
|
|
|
|
export type TfaCompletedResponse = SuccessResponse;
|
|
|
|
export type SignupResponse = SuccessResponse;
|
|
|
|
export type RefreshResponse = LoginResponse;
|
|
|
|
|
2022-08-25 11:39:58 +00:00
|
|
|
export class LoginResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsJWT()
|
2022-08-24 14:15:33 +00:00
|
|
|
jwt: string;
|
|
|
|
}
|
|
|
|
|
2022-08-25 11:39:58 +00:00
|
|
|
export class RequestTotpTfaResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-08-24 14:15:33 +00:00
|
|
|
qrCode: string;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
@IsBase32()
|
2022-08-24 14:15:33 +00:00
|
|
|
secret: string;
|
|
|
|
}
|