feat(DTOExtensions): Optionale minutesBeforeExpiration Eingaben zu IsTotpSecretInvalid und IsTotpSecretValid Methoden hinzugefügt.
This commit is contained in:
parent
ff6d27df8e
commit
1657a99aa6
@ -7,8 +7,10 @@ namespace EnvelopeGenerator.Application.Extensions
|
||||
public static bool IsTotpSecretExpired(this ReceiverReadDto dto, int minutesBeforeExpiration = 30)
|
||||
=> dto.TotpExpiration < DateTime.Now.AddMinutes(minutesBeforeExpiration * -1);
|
||||
|
||||
public static bool IsTotpSecretInvalid(this ReceiverReadDto dto) => dto.IsTotpSecretExpired() || dto.TotpSecretkey is null;
|
||||
public static bool IsTotpSecretInvalid(this ReceiverReadDto dto, int minutesBeforeExpiration = 30)
|
||||
=> dto.IsTotpSecretExpired(minutesBeforeExpiration) || dto.TotpSecretkey is null;
|
||||
|
||||
public static bool IsTotpSecretValid(this ReceiverReadDto dto) => !dto.IsTotpSecretInvalid();
|
||||
public static bool IsTotpSecretValid(this ReceiverReadDto dto, int minutesBeforeExpiration = 30)
|
||||
=> !dto.IsTotpSecretInvalid(minutesBeforeExpiration);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user