More checks on TFA

This commit is contained in:
augustin64
2024-04-10 12:14:41 +02:00
parent 1a8137783c
commit 52e88f81b9
3 changed files with 16 additions and 9 deletions

View File

@ -30,7 +30,8 @@ class UserCredentials:
def get_tfa(self):
if not self.tfa_enable():
warning("Warning: TFA is not enabled. Calling get_tfa is an expected behaviour.")
warning("Warning: TFA is not enabled. Can't get a TFA code.")
return None
return TOTP(self.data[self.current]["2fa"])
def next_account(self):