Refactor controllers and views for MediatR integration
Updated several C# controllers to use the new
`DigitalData.Core.Abstraction.Application.DTO` namespace
and removed references to `DigitalData.Core.DTO`. Added
`[Obsolete("Use MediatR")]` attributes to indicate a shift
towards MediatR for request handling. Improved error
handling and code organization in key methods. Updated
Razor view files to reflect namespace changes for
consistency across the application.
This commit is contained in:
@@ -4,25 +4,28 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using EnvelopeGenerator.Extensions;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using EnvelopeGenerator.Application.Resources;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using static EnvelopeGenerator.CommonServices.Constants;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using static EnvelopeGenerator.Domain.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
//TODO: Add authorization as well as limiting the link duration (intermediate token with different role) or sign it
|
||||
public class TFARegController : ViewControllerBase
|
||||
{
|
||||
[Obsolete("Use MediatR")]
|
||||
private readonly IEnvelopeReceiverService _envRcvService;
|
||||
private readonly IAuthenticator _authenticator;
|
||||
[Obsolete("Use MediatR")]
|
||||
private readonly IReceiverService _rcvService;
|
||||
private readonly TFARegParams _params;
|
||||
|
||||
[Obsolete("Use MediatR")]
|
||||
public TFARegController(ILogger<TFARegController> logger, HtmlSanitizer sanitizer, Cultures cultures, IStringLocalizer<Resource> localizer, IEnvelopeReceiverService erService, IAuthenticator authenticator, IReceiverService receiverService, IOptions<TFARegParams> tfaRegParamsOptions) : base(logger, sanitizer, cultures, localizer)
|
||||
{
|
||||
_envRcvService = erService;
|
||||
@@ -34,6 +37,7 @@ public class TFARegController : ViewControllerBase
|
||||
//TODO: move under auth route
|
||||
[Authorize]
|
||||
[HttpGet("tfa/{envelopeReceiverId}")]
|
||||
[Obsolete("Use MediatR")]
|
||||
public async Task<IActionResult> Reg(string envelopeReceiverId)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user