import { SuccessResponse } from './base'; import { IsBase32, IsJWT, IsNotEmpty } from 'class-validator'; import { ValidateConstructor } from '../utils'; @ValidateConstructor export class LoginResponse extends SuccessResponse { constructor(jwt: string) { super(); this.jwt = jwt; } @IsNotEmpty() @IsJWT() jwt: string; } @ValidateConstructor export class RequestTotpTfaResponse extends SuccessResponse { constructor(qrCode: string, secret: string) { super(); this.qrCode = qrCode; this.secret = secret; } @IsNotEmpty() qrCode: string; @IsNotEmpty() @IsBase32() secret: string; } 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 {} export class ChangePasswordResponse extends SuccessResponse {} export class LogoutAllResponse extends SuccessResponse {} export class RefreshResponse extends LoginResponse {}