v0.0.3
This commit is contained in:
parent
490e9bb80c
commit
407fa6351d
3
app.py
3
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))
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue