From e71622e2365ce8bbbeddfb06ab1dc9e59cb6e7ab Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Fri, 3 May 2024 21:47:05 +0200 Subject: [PATCH] Fix totp parsing --- gui/src/services/totp.py | 4 ++++ 1 file changed, 4 insertions(+) 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