implement receiver already signed method

This commit is contained in:
2025-08-22 21:38:53 +02:00
parent bd7c1d4e36
commit e61d626bf3
2 changed files with 6 additions and 6 deletions

View File

@@ -22,7 +22,6 @@ using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Domain.Entities;
using MediatR;
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
using EnvelopeGenerator.Application.Extensions;
namespace EnvelopeGenerator.Web.Controllers;
@@ -406,7 +405,7 @@ public class HomeController : ViewControllerBase
[Authorize(Roles = ReceiverRole.FullyAuth)]
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Success")]
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId)
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId, CancellationToken cancel)
{
try
{
@@ -417,8 +416,8 @@ public class HomeController : ViewControllerBase
if(!isExisting)
return this.ViewEnvelopeNotFound();
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
if (!envelopeOldService.ReceiverAlreadySigned((Envelope)response.Envelope, (int)response.Receiver.Id))
var signed = await _mediator.ReceiverAlreadySigned(envelopeReceiverId, cancel);
if (signed)
return base.Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);