2022-08-25 12:16:29 +00:00
|
|
|
import { SuccessResponse } from './base';
|
2022-08-25 11:39:58 +00:00
|
|
|
import { IsBase32, IsJWT, IsNotEmpty } from 'class-validator';
|
2022-08-25 13:13:44 +00:00
|
|
|
import { ValidateConstructor } from '../utils';
|
2022-08-24 14:15:33 +00:00
|
|
|
|
2022-08-25 13:13:44 +00:00
|
|
|
@ValidateConstructor
|
2022-08-25 12:16:29 +00:00
|
|
|
export class LoginResponse extends SuccessResponse {
|
2022-08-25 13:13:44 +00:00
|
|
|
constructor(jwt: string) {
|
|
|
|
super();
|
|
|
|
this.jwt = jwt;
|
|
|
|
}
|
|
|
|
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsNotEmpty()
|
|
|
|
@IsJWT()
|
2022-08-24 14:15:33 +00:00
|
|
|
jwt: string;
|
|
|
|
}
|
|
|
|
|
2022-08-25 13:13:44 +00:00
|
|
|
@ValidateConstructor
|
2022-08-25 12:16:29 +00:00
|
|
|
export class RequestTotpTfaResponse extends SuccessResponse {
|
2022-08-25 13:13:44 +00:00
|
|
|
constructor(qrCode: string, secret: string) {
|
|
|
|
super();
|
|
|
|
this.qrCode = qrCode;
|
|
|
|
this.secret = secret;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
2022-08-25 13:13:44 +00:00
|
|
|
|
|
|
|
export class TfaRequiredResponse extends SuccessResponse {}
|
|
|
|
export class RemoveTfaResponse extends SuccessResponse {}
|
|
|
|
export class RequestEmailTfaResponse extends SuccessResponse {}
|
|
|
|
export class TfaCompletedResponse extends SuccessResponse {}
|
|
|
|
export class SignupResponse extends SuccessResponse {}
|
2022-08-25 11:27:47 +00:00
|
|
|
export class ChangePasswordResponse extends SuccessResponse {}
|
2022-08-25 15:52:23 +00:00
|
|
|
export class LogoutAllResponse extends SuccessResponse {}
|
2022-08-25 13:13:44 +00:00
|
|
|
export class RefreshResponse extends LoginResponse {}
|