We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b97860 commit b67c86fCopy full SHA for b67c86f
1 file changed
src/client/totp_generator.py
@@ -9,6 +9,8 @@ class TOTPGenerator:
9
TOTP_INTERVAL_SECONDS: ClassVar[int] = 60
10
11
def __init__(self, seed_base64: str) -> None:
12
+ if not seed_base64:
13
+ raise ValueError("Seed cannot be empty")
14
bytes_seed: bytes = b64decode(seed_base64)
15
seed_base32 = b32encode(bytes_seed).decode("utf-8")
16
self.__totp = TOTP(seed_base32, interval=self.TOTP_INTERVAL_SECONDS)
0 commit comments