refactor(Extensions): move to common

This commit is contained in:
2025-09-09 18:26:06 +02:00
parent 895eb8977e
commit fbfc20705d
26 changed files with 35 additions and 32 deletions

View File

@@ -0,0 +1,14 @@
using OtpNet;
namespace EnvelopeGenerator.Application.Common.Extensions
{
public static class StringExtension
{
public static bool IsValidTotp(this string totp, string secret)
{
var secret_bytes = Base32Encoding.ToBytes(secret);
var secret_totp = new Totp(secret_bytes);
return secret_totp.VerifyTotp(totp, out _, VerificationWindow.RfcSpecifiedNetworkDelay);
}
}
}