refactor(EnvelopeReceiver): TFAEnabled wurde in die Envelope-Tabelle für Entität und DTO verschoben.
- Aktualisierte zugehörige Felder in HomeController.
This commit is contained in:
parent
713c2f3ed2
commit
867756242e
@ -51,6 +51,8 @@ namespace EnvelopeGenerator.Application.DTOs
|
||||
|
||||
public int? ExpiresWarningWhenDays { get; set; }
|
||||
|
||||
public bool TFAEnabled { get; init; }
|
||||
|
||||
public bool DmzMoved { get; set; }
|
||||
public UserReadDto? User { get; set; }
|
||||
public EnvelopeType? EnvelopeType { get; set; }
|
||||
|
||||
@ -27,7 +27,5 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
||||
public DateTime? ChangedWhen { get; init; }
|
||||
|
||||
public bool HasPhoneNumber { get; init; }
|
||||
|
||||
public bool TFAEnabled { get; init; }
|
||||
}
|
||||
}
|
||||
@ -84,6 +84,9 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Column("EXPIRES_WARNING_WHEN_DAYS")]
|
||||
public int? ExpiresWarningWhenDays { get; set; }
|
||||
|
||||
[Column("TFA_ENABLED", TypeName = "bit")]
|
||||
public bool TFAEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The sender of envelope
|
||||
/// </summary>
|
||||
|
||||
@ -46,9 +46,6 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
[Column("TFA_ENABLED", TypeName = "bit")]
|
||||
public bool TFAEnabled { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
return await _envRcvService.ReadByEnvelopeReceiverIdAsync(envelopeReceiverId: envelopeReceiverId).ThenAsync(
|
||||
Success: er => View()
|
||||
.WithData("EnvelopeKey", envelopeReceiverId)
|
||||
.WithData("TFAEnabled", er.TFAEnabled)
|
||||
.WithData("TFAEnabled", er.Envelope!.TFAEnabled)
|
||||
.WithData("HasPhoneNumber", er.HasPhoneNumber),
|
||||
Fail: IActionResult (messages, notices) =>
|
||||
{
|
||||
@ -229,7 +229,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
await _historyService.RecordAsync(er_secret.EnvelopeId, er_secret.Receiver!.EmailAddress, EnvelopeStatus.AccessCodeCorrect);
|
||||
|
||||
//check if the user has phone is added
|
||||
if (er_secret.TFAEnabled)
|
||||
if (er_secret.Envelope!.TFAEnabled)
|
||||
{
|
||||
var rcv = er_secret.Receiver;
|
||||
if (rcv.IsTotpSecretInvalid())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user