I'm using Pyotp for generating OTP. Default expiry of this token is 30sec. How can I change the default expiry to some 60 seconds? This is the simple code I'm using.
secret = pyotp.random_base32()
totp = pyotp.TOTP(secret)
otp = totp.now()
I'm using Pyotp for generating OTP. Default expiry of this token is 30sec. How can I change the default expiry to some 60 seconds? This is the simple code I'm using.
secret = pyotp.random_base32()
totp = pyotp.TOTP(secret)
otp = totp.now()
Here, give this a try, It did work for me.
totp = pyotp.TOTP(secret, interval=60)
© 2022 - 2024 — McMap. All rights reserved.