Only refresh the mfa key on 15-second intervals

This commit is contained in:
2022-06-22 01:28:36 -04:00
parent 0eaccc3edf
commit d041af3b4d
+2 -1
View File
@@ -10,7 +10,7 @@ from sshyp import decrypt, entry_list_gen, shm_gen
from steam.guard import generate_twofactor_code as steam_totp
from struct import pack, unpack
from sys import argv, exit as s_exit
from time import sleep, time
from time import sleep, strftime, time
def totp(_secret, _algo, _digits, _period):
@@ -59,6 +59,7 @@ if __name__ == '__main__':
'updated with the newest mfa key')
while True:
sleep(1)
if str(int(strftime('%S'))/15).endswith('.0'):
if mfa_data[0] == 'steam':
_mfa_key = steam_totp(b32decode(mfa_data[1]))
else: