mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
Allow disabling two-factor authentication (2FA) by using either their authenticator app (TOTP) or a backup code.
25 lines
749 B
TypeScript
25 lines
749 B
TypeScript
import { z } from 'zod';
|
|
|
|
export const ZEnableTwoFactorAuthenticationMutationSchema = z.object({
|
|
code: z.string().min(6).max(6),
|
|
});
|
|
|
|
export type TEnableTwoFactorAuthenticationMutationSchema = z.infer<
|
|
typeof ZEnableTwoFactorAuthenticationMutationSchema
|
|
>;
|
|
|
|
export const ZDisableTwoFactorAuthenticationMutationSchema = z.object({
|
|
totpCode: z.string().trim().optional(),
|
|
backupCode: z.string().trim().optional(),
|
|
});
|
|
|
|
export type TDisableTwoFactorAuthenticationMutationSchema = z.infer<
|
|
typeof ZDisableTwoFactorAuthenticationMutationSchema
|
|
>;
|
|
|
|
export const ZViewRecoveryCodesMutationSchema = z.object({
|
|
token: z.string().trim().min(1),
|
|
});
|
|
|
|
export type TViewRecoveryCodesMutationSchema = z.infer<typeof ZViewRecoveryCodesMutationSchema>;
|