diff --git a/app/views.py b/app/views.py index 41d3201..5ae6005 100644 --- a/app/views.py +++ b/app/views.py @@ -39,23 +39,13 @@ def login(request, *args, **kwargs): 'success': False } else: - key = Fernet.generate_key() + request.session[request.session.session_key] = Fernet.generate_key().decode('utf-8') + key = bytes(request.session[request.session.session_key], 'utf-8') rkey = Fernet(key) - x = None - request.session[request.session.session_key] = key.decode('utf-8') - - while x == None: - try: - x = request.session[request.session.session_key] - x = x - except KeyError: - x = None - sender_return['s'] = json.dumps(sender_return['s']) sender_return['s'] = sender_return['s'].encode() sender_return['s'] = rkey.encrypt(sender_return['s']) sender_return['s'] = sender_return['s'].decode('utf-8') - request.session['is_logged'] = True data_response = {'success': True, 'data': sender_return} return JsonResponse(data_response) @@ -267,6 +257,7 @@ def dashboard(request, *args, **kwargs): register_r = data['data']['register_r'] s = data['data']['s'] key = bytes(request.session[request.session.session_key], 'utf-8') + print(key) s = decrypt_cookies(s, key) diary_url = data['data']['diary_url'] symbol = data['data']['symbol'] diff --git a/frontend/static/frontend/css/style.css b/frontend/static/frontend/css/style.css index a68329a..327340c 100644 --- a/frontend/static/frontend/css/style.css +++ b/frontend/static/frontend/css/style.css @@ -109,6 +109,9 @@ select { #button { margin-left: 35rem; } +#button-loadnig { + margin-left: 35rem; +} #con { margin-bottom: 12.5%; } diff --git a/frontend/templates/frontend/index.html b/frontend/templates/frontend/index.html index 744e869..81373d9 100644 --- a/frontend/templates/frontend/index.html +++ b/frontend/templates/frontend/index.html @@ -53,7 +53,7 @@
Gdzie mogę znaleźć symbol? - +