mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
feat: disable 2fa with backup codes (#1314)
Allow disabling two-factor authentication (2FA) by using either their authenticator app (TOTP) or a backup code.
This commit is contained in:
@ -65,7 +65,8 @@ export const twoFactorAuthenticationRouter = router({
|
||||
|
||||
return await disableTwoFactorAuthentication({
|
||||
user,
|
||||
token: input.token,
|
||||
totpCode: input.totpCode,
|
||||
backupCode: input.backupCode,
|
||||
requestMetadata: extractNextApiRequestMetadata(ctx.req),
|
||||
});
|
||||
} catch (err) {
|
||||
|
||||
@ -9,7 +9,8 @@ export type TEnableTwoFactorAuthenticationMutationSchema = z.infer<
|
||||
>;
|
||||
|
||||
export const ZDisableTwoFactorAuthenticationMutationSchema = z.object({
|
||||
token: z.string().trim().min(1),
|
||||
totpCode: z.string().trim().optional(),
|
||||
backupCode: z.string().trim().optional(),
|
||||
});
|
||||
|
||||
export type TDisableTwoFactorAuthenticationMutationSchema = z.infer<
|
||||
|
||||
Reference in New Issue
Block a user