feat(ViewControllerBase): Erstellt, um allgemeine Eigenschaften von ViewControllern zu behandeln.

- Implementiert in TFARegController.
 - Implementiert in HomeController.
This commit is contained in:
Developer 02 2025-02-05 12:58:30 +01:00
parent e27daa4b90
commit 152050ebf4
3 changed files with 521 additions and 494 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,26 @@
using Microsoft.AspNetCore.Mvc;
using EnvelopeGenerator.Application.Contracts;
using EnvelopeGenerator.Web.Models;
using Ganss.Xss;
using Microsoft.AspNetCore.Mvc;
using EnvelopeGenerator.Extensions;
using Microsoft.Extensions.Localization;
using EnvelopeGenerator.Application.Resources;
namespace EnvelopeGenerator.Web.Controllers;
//TODO: Add authorization as well as limiting the link duration (intermediate token with different role)
//TODO: Add authorization as well as limiting the link duration (intermediate token with different role) or sign it
[Route("tfa")]
public class TFARegController : Controller
public class TFARegController : ViewControllerBase
{
[HttpGet("{key}")]
public IActionResult Reg(string key)
private readonly IEnvelopeReceiverService _erService;
public TFARegController(ILogger<TFARegController> logger, HtmlSanitizer sanitizer, Cultures cultures, IStringLocalizer<Resource> localizer, IEnvelopeReceiverService erService) : base(logger, sanitizer, cultures, localizer)
{
_erService = erService;
}
[HttpGet("{envelopeReceiverId}")]
public IActionResult Reg(string envelopeReceiverId)
{
return View();
}

View File

@ -0,0 +1,23 @@
using EnvelopeGenerator.Web.Models;
using Ganss.Xss;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using EnvelopeGenerator.Application.Resources;
namespace EnvelopeGenerator.Web.Controllers;
public class ViewControllerBase : Controller
{
protected readonly ILogger _logger;
protected readonly HtmlSanitizer _sanitizer;
protected readonly Cultures _cultures;
protected readonly IStringLocalizer<Resource> _localizer;
public ViewControllerBase(ILogger logger, HtmlSanitizer sanitizer, Cultures cultures, IStringLocalizer<Resource> localizer)
{
_logger = logger;
_sanitizer = sanitizer;
_cultures = cultures;
_localizer = localizer;
}
}