diff --git a/gui/src/services/totp.py b/gui/src/services/totp.py index ff3fa5b..9893bd8 100644 --- a/gui/src/services/totp.py +++ b/gui/src/services/totp.py @@ -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) \ No newline at end of file