Skip to content

Commit

Permalink
chore: check if is validating from email before throw exception
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jan 11, 2025
1 parent 0f0824a commit d6bdd48
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions lib/Service/IdentifyMethod/AbstractIdentifyMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,22 +225,25 @@ protected function throwIfRenewalIntervalExpired(): void {
]);
if ($lastActionDate + $renewalInterval < $now) {
$this->identifyService->getLogger()->debug('AbstractIdentifyMethod::throwIfRenewalIntervalExpired Exception');
$blur = new Blur($this->getEntity()->getIdentifierValue());
throw new LibresignException(json_encode([
'action' => $this->getRenewAction(),
// TRANSLATORS title that is displayed at screen to notify the signer that the link to sign the document expired
'title' => $this->identifyService->getL10n()->t('Link expired'),
'body' => $this->identifyService->getL10n()->t(<<<'BODY'
The link to sign the document has expired.
We will send a new link to the email %1$s.
Click below to receive the new link and be able to sign the document.
BODY,
[$blur->make()]
),
'uuid' => $signRequest->getUuid(),
// TRANSLATORS Button to renew the link to sign the document. Renew is the action to generate a new sign link when the link expired.
'renewButton' => $this->identifyService->getL10n()->t('Renew'),
]));
if ($this->getName() === 'email') {
$blur = new Blur($this->getEntity()->getIdentifierValue());
throw new LibresignException(json_encode([
'action' => $this->getRenewAction(),
// TRANSLATORS title that is displayed at screen to notify the signer that the link to sign the document expired
'title' => $this->identifyService->getL10n()->t('Link expired'),
'body' => $this->identifyService->getL10n()->t(<<<'BODY'
The link to sign the document has expired.
We will send a new link to the email %1$s.
Click below to receive the new link and be able to sign the document.
BODY,
[$blur->make()]
),
'uuid' => $signRequest->getUuid(),
// TRANSLATORS Button to renew the link to sign the document. Renew is the action to generate a new sign link when the link expired.
'renewButton' => $this->identifyService->getL10n()->t('Renew'),
]));
}
$this->validateToRenew($this->user);
}
}

Expand Down

0 comments on commit d6bdd48

Please sign in to comment.