mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 18:51:37 +10:00
fix: polish
This commit is contained in:
@ -151,7 +151,7 @@ test('[DOCUMENT_AUTH]: should deny signing document when required for global aut
|
||||
|
||||
await page.getByRole('button', { name: 'Complete' }).click();
|
||||
await expect(page.getByRole('paragraph')).toContainText(
|
||||
'Reauthentication is required to sign the document',
|
||||
'Reauthentication is required to sign this document',
|
||||
);
|
||||
|
||||
await unseedUser(user.id);
|
||||
@ -186,7 +186,7 @@ test('[DOCUMENT_AUTH]: should deny signing fields when required for global auth'
|
||||
for (const field of Field) {
|
||||
await page.locator(`#field-${field.id}`).getByRole('button').click();
|
||||
await expect(page.getByRole('paragraph')).toContainText(
|
||||
'Reauthentication is required to sign the field',
|
||||
'Reauthentication is required to sign this field',
|
||||
);
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
}
|
||||
@ -251,7 +251,7 @@ test('[DOCUMENT_AUTH]: should allow field signing when required for recipient au
|
||||
for (const field of Field) {
|
||||
await page.locator(`#field-${field.id}`).getByRole('button').click();
|
||||
await expect(page.getByRole('paragraph')).toContainText(
|
||||
'Reauthentication is required to sign the field',
|
||||
'Reauthentication is required to sign this field',
|
||||
);
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
}
|
||||
@ -358,7 +358,7 @@ test('[DOCUMENT_AUTH]: should allow field signing when required for recipient an
|
||||
for (const field of Field) {
|
||||
await page.locator(`#field-${field.id}`).getByRole('button').click();
|
||||
await expect(page.getByRole('paragraph')).toContainText(
|
||||
'Reauthentication is required to sign the field',
|
||||
'Reauthentication is required to sign this field',
|
||||
);
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
}
|
||||
|
||||
@ -67,6 +67,13 @@ export const isRecipientAuthorized = async ({
|
||||
return true;
|
||||
}
|
||||
|
||||
// Create auth options when none are passed for account.
|
||||
if (!authOptions && authMethod === DocumentAuth.ACCOUNT) {
|
||||
authOptions = {
|
||||
type: DocumentAuth.ACCOUNT,
|
||||
};
|
||||
}
|
||||
|
||||
// Authentication required does not match provided method.
|
||||
if (!authOptions || authOptions.type !== authMethod) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user