From 407fa6351d5b69c519a6cb621ce50e0406db927d Mon Sep 17 00:00:00 2001 From: aitzol Date: Sun, 26 Nov 2023 18:49:05 +0100 Subject: [PATCH] v0.0.3 --- app.py | 3 +-- libs/helper.py | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 6cf0b0a..6a5c135 100644 --- a/app.py +++ b/app.py @@ -39,7 +39,6 @@ from user_agents import parse as ua_parse from datetime import datetime import cryptocode import base64 -import uuid BASE_DIR = path.dirname(__file__) LOG = logging.getLogger(__name__) @@ -161,7 +160,7 @@ def post_user(): #if(check_2fa_step1(form('username'))): if(newSession().get()['secureAuth']): # encrypt and store the credentials - key = uuid.uuid4().hex + key = tools.key() data = ';'.join([form('username'),form('password'),newSession().get()['authCode']]) data_enc = cryptocode.encrypt(data, key) data_to_url = base64.urlsafe_b64encode(str.encode(data_enc)) diff --git a/libs/helper.py b/libs/helper.py index c4d1592..1b632fc 100644 --- a/libs/helper.py +++ b/libs/helper.py @@ -6,6 +6,7 @@ from onetimepass import valid_totp from secrets import choice import segno from os import path +import uuid class Tools(): @@ -69,4 +70,7 @@ class Tools(): print('Wrong otp, please try again.') return False + def key(self): + return uuid.uuid4().hex + tools = Tools()