mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
feat: support 2fa for document completion (#2063)
Adds support for 2FA when completing a document, also adds support for using email for 2FA when no authenticator has been associated with the account.
This commit is contained in:
@ -159,6 +159,7 @@ export const createDocumentFromDirectTemplate = async ({
|
||||
// Ensure typesafety when we add more options.
|
||||
const isAccessAuthValid = match(derivedRecipientAccessAuth.at(0))
|
||||
.with(DocumentAccessAuth.ACCOUNT, () => user && user?.email === directRecipientEmail)
|
||||
.with(DocumentAccessAuth.TWO_FACTOR_AUTH, () => false) // Not supported for direct templates
|
||||
.with(undefined, () => true)
|
||||
.exhaustive();
|
||||
|
||||
@ -205,6 +206,7 @@ export const createDocumentFromDirectTemplate = async ({
|
||||
recipient: {
|
||||
authOptions: directTemplateRecipient.authOptions,
|
||||
email: directRecipientEmail,
|
||||
documentId: template.id,
|
||||
},
|
||||
field: templateField,
|
||||
userId: user?.id,
|
||||
|
||||
Reference in New Issue
Block a user