feat(TFARegController): Authentifizierungsbedingung zum Registrierungsendpunkt hinzugefügt

This commit is contained in:
Developer 02
2025-02-07 13:31:54 +01:00
parent ca4718e159
commit 4eec4451b2
2 changed files with 5 additions and 0 deletions

View File

@@ -200,6 +200,9 @@ public class HomeController : ViewControllerBase
rcv.TotpSecretkey = _authenticator.GenerateTotpSecretKey(); rcv.TotpSecretkey = _authenticator.GenerateTotpSecretKey();
await _rcvService.UpdateAsync(rcv); await _rcvService.UpdateAsync(rcv);
} }
await HttpContext.SignInEnvelopeAsync(er_secret, ReceiverRole.PreAuth);
return await TFAViewAsync(auth.UserSelectSMS, er_secret, envelopeReceiverId); return await TFAViewAsync(auth.UserSelectSMS, er_secret, envelopeReceiverId);
} }

View File

@@ -8,6 +8,7 @@ using EnvelopeGenerator.Application.Resources;
using DigitalData.Core.DTO; using DigitalData.Core.DTO;
using EnvelopeGenerator.Application.Extensions; using EnvelopeGenerator.Application.Extensions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Authorization;
namespace EnvelopeGenerator.Web.Controllers; namespace EnvelopeGenerator.Web.Controllers;
@@ -28,6 +29,7 @@ public class TFARegController : ViewControllerBase
_params = tfaRegParamsOptions.Value; _params = tfaRegParamsOptions.Value;
} }
[Authorize]
[HttpGet("{envelopeReceiverId}")] [HttpGet("{envelopeReceiverId}")]
public async Task<IActionResult> Reg(string envelopeReceiverId) public async Task<IActionResult> Reg(string envelopeReceiverId)
{ {