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