moved the initialisation to Config.py
This commit is contained in:
parent
6be44e829a
commit
da707ade5a
|
@ -3,16 +3,10 @@ from modules.Tools.logger import debug, warning
|
||||||
|
|
||||||
|
|
||||||
class UserCredentials:
|
class UserCredentials:
|
||||||
def __init__(self, config_id: int):
|
def __init__(self):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self.current = 0
|
self.current = 0
|
||||||
self.total = 0
|
self.total = 0
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
|
||||||
configs = json.load(inFile)
|
|
||||||
for i in configs[str(config_id)]["accounts"]:
|
|
||||||
d = configs[str(config_id)]["accounts"][i]
|
|
||||||
self.add(d["mail"], d["pwd"], d["2fa"])
|
|
||||||
debug(f"Initiated UserCredentials.")
|
|
||||||
|
|
||||||
def add(self, username: str, password: str, tfa: str = None):
|
def add(self, username: str, password: str, tfa: str = None):
|
||||||
debug(f"adding account with data : Username: {username}, Password: {password}, 2FA: {'None' if tfa == '' else tfa}")
|
debug(f"adding account with data : Username: {username}, Password: {password}, 2FA: {'None' if tfa == '' else tfa}")
|
||||||
|
|
Loading…
Reference in New Issue