Skip to content

Commit

Permalink
Modified timestamp to 2 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarwal4 committed Apr 12, 2024
1 parent e2277fa commit f4e6dcf
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 f4e6dcf

Please sign in to comment.