refactor(HomeController): remove envelopeSigned endpoint

This commit is contained in:
2025-09-17 13:07:06 +02:00
parent 56074c2b9f
commit cf3535b4de
3 changed files with 5 additions and 36 deletions

View File

@@ -166,7 +166,10 @@ public class HomeController : ViewControllerBase
//check if it has already signed
if (await _historyService.IsSigned(envelopeId: er.Envelope!.Id, userReference: er.Receiver!.EmailAddress))
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return View("EnvelopeSigned");
}
if (er.Envelope.Documents?.FirstOrDefault() is DocumentDto doc && doc.ByteData is not null)
{
@@ -367,40 +370,6 @@ public class HomeController : ViewControllerBase
}
}
[Authorize(Roles = ReceiverRole.FullyAuth)]
[HttpGet("{envelopeReceiverId}/Success")]
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
public async Task<IActionResult> EnvelopeSigned([FromRoute] string envelopeReceiverId, CancellationToken cancel)
{
try
{
return await _envRcvService.IsExisting(envelopeReceiverId: envelopeReceiverId).ThenAsync(
SuccessAsync: (Func<bool, Task<IActionResult>>)(async isExisting =>
{
if(!isExisting)
return this.ViewEnvelopeNotFound();
var signed = await _mediator.IsSignedAsync(envelopeReceiverId, cancel);
if (signed)
return base.Redirect($"/Envelope/{envelopeReceiverId}/Locked");
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
ViewData["EnvelopeKey"] = envelopeReceiverId;
return base.View();
}),
Fail: IActionResult (messages, notices) =>
{
_logger.LogNotice(notices);
return this.ViewEnvelopeNotFound();
});
}
catch (Exception ex)
{
_logger.LogEnvelopeError(envelopeReceiverId: envelopeReceiverId, exception: ex);
return this.ViewInnerServiceError();
}
}
[Authorize(Roles = ReceiverRole.FullyAuth)]
[HttpGet("{envelopeReceiverId}/Rejected")]
[Obsolete("Use MediatR")]