Fix InvalidToken error
This commit is contained in:
parent
b45cde1dbf
commit
03f7808b3d
2 changed files with 4 additions and 7 deletions
|
@ -40,13 +40,8 @@ def login(request, *args, **kwargs):
|
|||
}
|
||||
else:
|
||||
request.session['is_logged'] = True
|
||||
while True:
|
||||
try:
|
||||
request.session[request.session.session_key] = Fernet.generate_key().decode('utf-8')
|
||||
rkey = Fernet(bytes(request.session[request.session.session_key], 'utf-8'))
|
||||
break
|
||||
except KeyError:
|
||||
continue
|
||||
request.session[request.session.session_key] = Fernet.generate_key().decode('utf-8')
|
||||
rkey = Fernet(bytes(request.session[request.session.session_key], 'utf-8'))
|
||||
|
||||
sender_return['s'] = json.dumps(sender_return['s'])
|
||||
sender_return['s'] = sender_return['s'].encode()
|
||||
|
|
|
@ -5,6 +5,7 @@ const login = () => {
|
|||
const Password = document.querySelector('#id_Password').value;
|
||||
const symbol = document.querySelector('#id_Symbol').value;
|
||||
const diary = document.querySelector('#id_diary').value;
|
||||
button.removeEventListener('click', login)
|
||||
if(loginName != '' && Password != '' && symbol != ''){
|
||||
switch(diary){
|
||||
case 'Fakelog':
|
||||
|
@ -43,6 +44,7 @@ const login = () => {
|
|||
else{
|
||||
document.querySelector('#error').innerHTML = 'Nieprawidłowy login, hasło lub symbol';
|
||||
}
|
||||
button.addEventListener('click', login);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue