mirror of
https://github.com/quexten/goldwarden.git
synced 2025-02-10 00:50:43 +01:00
Fix totp parsing
This commit is contained in:
parent
70f6a47fd5
commit
e71622e236
@ -17,4 +17,8 @@ def hotp(key, counter, digits=6, digest='sha1'):
|
||||
|
||||
|
||||
def totp(key, time_step=30, digits=6, digest='sha1'):
|
||||
if key.startswith('otpauth://'):
|
||||
key = key.split('secret=')[1].split('&')[0]
|
||||
key = key.replace(' ', '')
|
||||
key = key.strip()
|
||||
return hotp(key, int(time.time() / time_step), digits, digest)
|
Loading…
x
Reference in New Issue
Block a user