Skip to content

Commit b67c86f

Browse files
committed
feat: Added empty seed raise Exception
1 parent 3b97860 commit b67c86f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/client/totp_generator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class TOTPGenerator:
99
TOTP_INTERVAL_SECONDS: ClassVar[int] = 60
1010

1111
def __init__(self, seed_base64: str) -> None:
12+
if not seed_base64:
13+
raise ValueError("Seed cannot be empty")
1214
bytes_seed: bytes = b64decode(seed_base64)
1315
seed_base32 = b32encode(bytes_seed).decode("utf-8")
1416
self.__totp = TOTP(seed_base32, interval=self.TOTP_INTERVAL_SECONDS)

0 commit comments

Comments
 (0)