|
|
|
|
@@ -22,6 +22,7 @@ using EnvelopeGenerator.Domain.Constants;
|
|
|
|
|
|
|
|
|
|
namespace EnvelopeGenerator.Web.Controllers;
|
|
|
|
|
|
|
|
|
|
[Route("Envelope")]
|
|
|
|
|
public class HomeController : ViewControllerBase
|
|
|
|
|
{
|
|
|
|
|
[Obsolete("Use MediatR")]
|
|
|
|
|
@@ -63,7 +64,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("EnvelopeKey/{envelopeReceiverId}")]
|
|
|
|
|
[HttpGet("{envelopeReceiverId}")]
|
|
|
|
|
[Obsolete("Use MediatR")]
|
|
|
|
|
public async Task<IActionResult> MainAsync([FromRoute] string envelopeReceiverId)
|
|
|
|
|
{
|
|
|
|
|
@@ -107,7 +108,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Locked")]
|
|
|
|
|
[HttpGet("{envelopeReceiverId}/Locked")]
|
|
|
|
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
|
|
|
|
public async Task<IActionResult> EnvelopeLocked([FromRoute] string envelopeReceiverId)
|
|
|
|
|
{
|
|
|
|
|
@@ -294,7 +295,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
[HttpPost("EnvelopeKey/{envelopeReceiverId}/Locked")]
|
|
|
|
|
[HttpPost("{envelopeReceiverId}/Locked")]
|
|
|
|
|
[Obsolete("Use MediatR")]
|
|
|
|
|
public async Task<IActionResult> LogInEnvelope([FromRoute] string envelopeReceiverId, [FromForm] Auth auth)
|
|
|
|
|
{
|
|
|
|
|
@@ -367,7 +368,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
|
|
|
|
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Success")]
|
|
|
|
|
[HttpGet("{envelopeReceiverId}/Success")]
|
|
|
|
|
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
|
|
|
|
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId, CancellationToken cancel)
|
|
|
|
|
{
|
|
|
|
|
@@ -381,7 +382,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
|
|
|
|
|
var signed = await _mediator.IsSignedAsync(envelopeReceiverId, cancel);
|
|
|
|
|
if (signed)
|
|
|
|
|
return base.Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
|
|
|
|
return base.Redirect($"/Envelope/{envelopeReceiverId}/Locked");
|
|
|
|
|
|
|
|
|
|
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
|
|
|
|
ViewData["EnvelopeKey"] = envelopeReceiverId;
|
|
|
|
|
@@ -401,7 +402,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
|
|
|
|
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Rejected")]
|
|
|
|
|
[HttpGet("{envelopeReceiverId}/Rejected")]
|
|
|
|
|
[Obsolete("Use MediatR")]
|
|
|
|
|
public async Task<IActionResult> EnvelopeRejected(string envelopeReceiverId)
|
|
|
|
|
{
|
|
|
|
|
@@ -413,7 +414,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
{
|
|
|
|
|
return await _historyService.IsRejected(envelopeId: er.EnvelopeId)
|
|
|
|
|
? View(er)
|
|
|
|
|
: Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
|
|
|
|
: Redirect($"/Envelope/{envelopeReceiverId}/Locked");
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
Fail: IActionResult (messages, notices) =>
|
|
|
|
|
@@ -429,7 +430,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("EnvelopeKey/{readOnlyKey}/ReadOnly")]
|
|
|
|
|
[HttpGet("{readOnlyKey}/ReadOnly")]
|
|
|
|
|
[Obsolete("Use MediatR")]
|
|
|
|
|
public async Task<IActionResult> EnvelopeReceiverReadOnly([FromRoute] string readOnlyKey)
|
|
|
|
|
{
|
|
|
|
|
@@ -499,7 +500,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
|
|
|
|
[HttpGet("IsAuthenticated")]
|
|
|
|
|
[HttpGet("/IsAuthenticated")]
|
|
|
|
|
public IActionResult IsAuthenticated()
|
|
|
|
|
{
|
|
|
|
|
var envelopeUuid = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
|
|
|
|
|
@@ -507,7 +508,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
return Ok(new { EnvelopeUuid = envelopeUuid, ReceiverSignature = receiverSignature });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpPost("lang/{culture}")]
|
|
|
|
|
[HttpPost("/lang/{culture}")]
|
|
|
|
|
public IActionResult SetLanguage([FromRoute] string culture)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
@@ -526,7 +527,7 @@ public class HomeController : ViewControllerBase
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HttpGet("lang")]
|
|
|
|
|
[HttpGet("/lang")]
|
|
|
|
|
public IActionResult GetLanguages() => Ok(_cultures.Languages);
|
|
|
|
|
|
|
|
|
|
public IActionResult Error404() => this.ViewError404();
|
|
|
|
|
|