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,7 +51,9 @@ namespace EnvelopeGenerator.Application.DTOs
|
|||||||
|
|
||||||
public int? ExpiresWarningWhenDays { get; set; }
|
public int? ExpiresWarningWhenDays { get; set; }
|
||||||
|
|
||||||
public bool DmzMoved { get; set; }
|
public bool TFAEnabled { get; init; }
|
||||||
|
|
||||||
|
public bool DmzMoved { get; set; }
|
||||||
public UserReadDto? User { get; set; }
|
public UserReadDto? User { get; set; }
|
||||||
public EnvelopeType? EnvelopeType { get; set; }
|
public EnvelopeType? EnvelopeType { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,5 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
|
|||||||
public DateTime? ChangedWhen { get; init; }
|
public DateTime? ChangedWhen { get; init; }
|
||||||
|
|
||||||
public bool HasPhoneNumber { 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")]
|
[Column("EXPIRES_WARNING_WHEN_DAYS")]
|
||||||
public int? ExpiresWarningWhenDays { get; set; }
|
public int? ExpiresWarningWhenDays { get; set; }
|
||||||
|
|
||||||
|
[Column("TFA_ENABLED", TypeName = "bit")]
|
||||||
|
public bool TFAEnabled { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The sender of envelope
|
/// The sender of envelope
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -45,10 +45,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
|||||||
[StringLength(20)]
|
[StringLength(20)]
|
||||||
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
|
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
|
||||||
public string? PhoneNumber { get; set; }
|
public string? PhoneNumber { get; set; }
|
||||||
|
|
||||||
[Column("TFA_ENABLED", TypeName = "bit")]
|
|
||||||
public bool TFAEnabled { get; set; }
|
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
|
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(
|
return await _envRcvService.ReadByEnvelopeReceiverIdAsync(envelopeReceiverId: envelopeReceiverId).ThenAsync(
|
||||||
Success: er => View()
|
Success: er => View()
|
||||||
.WithData("EnvelopeKey", envelopeReceiverId)
|
.WithData("EnvelopeKey", envelopeReceiverId)
|
||||||
.WithData("TFAEnabled", er.TFAEnabled)
|
.WithData("TFAEnabled", er.Envelope!.TFAEnabled)
|
||||||
.WithData("HasPhoneNumber", er.HasPhoneNumber),
|
.WithData("HasPhoneNumber", er.HasPhoneNumber),
|
||||||
Fail: IActionResult (messages, notices) =>
|
Fail: IActionResult (messages, notices) =>
|
||||||
{
|
{
|
||||||
@ -229,7 +229,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
|||||||
await _historyService.RecordAsync(er_secret.EnvelopeId, er_secret.Receiver!.EmailAddress, EnvelopeStatus.AccessCodeCorrect);
|
await _historyService.RecordAsync(er_secret.EnvelopeId, er_secret.Receiver!.EmailAddress, EnvelopeStatus.AccessCodeCorrect);
|
||||||
|
|
||||||
//check if the user has phone is added
|
//check if the user has phone is added
|
||||||
if (er_secret.TFAEnabled)
|
if (er_secret.Envelope!.TFAEnabled)
|
||||||
{
|
{
|
||||||
var rcv = er_secret.Receiver;
|
var rcv = er_secret.Receiver;
|
||||||
if (rcv.IsTotpSecretInvalid())
|
if (rcv.IsTotpSecretInvalid())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user