fileserver/dto/src/responses/auth.ts

29 lines
688 B
TypeScript
Raw Normal View History

import { BaseResponse, SuccessResponse } from './base';
2022-08-25 11:39:58 +00:00
import { IsBase32, IsJWT, IsNotEmpty } from 'class-validator';
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 {
statusCode: 200;
2022-08-25 11:39:58 +00:00
@IsNotEmpty()
@IsJWT()
jwt: string;
}
2022-08-25 11:39:58 +00:00
export class RequestTotpTfaResponse extends BaseResponse {
statusCode: 200;
2022-08-25 11:39:58 +00:00
@IsNotEmpty()
qrCode: string;
2022-08-25 11:39:58 +00:00
@IsNotEmpty()
@IsBase32()
secret: string;
}