Skip to content

Commit

Permalink
Merge branch 'main' into fix-get-customers
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarwal4 authored Apr 12, 2024
2 parents e741b61 + 3b6a00b commit 33e4407
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ public bool VerifyOTP(string otpKey, string otpCode)
var keyBytes = Base32Encoding.ToBytes(otpKey);

// Create a TOTP generator with the key and time step
var totp = new Totp(keyBytes, step: 30);
var totp = new Totp(keyBytes, step: 120);

// Verify the OTP code
return totp.VerifyTotp(otpCode, out _, VerificationWindow.RfcSpecifiedNetworkDelay);
bool isValid = totp.VerifyTotp(otpCode, out long timeStepMatched, VerificationWindow.RfcSpecifiedNetworkDelay);

return isValid;
}
catch
{
Expand Down

0 comments on commit 33e4407

Please sign in to comment.