fix: polish

This commit is contained in:
David Nguyen
2024-03-19 15:28:33 +08:00
parent 3282481ad7
commit fd881572f8
4 changed files with 29 additions and 16 deletions

View File

@ -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;