Fix logging out and the Remember me checkbox

This commit is contained in:
LoveEevee 2020-03-17 11:07:29 +03:00
parent a62184e0d2
commit 54a98b77d9
2 changed files with 4 additions and 3 deletions

3
app.py
View File

@ -397,8 +397,7 @@ def route_api_login():
session['session_id'] = result['session_id'] session['session_id'] = result['session_id']
session['username'] = result['username'] session['username'] = result['username']
if data.get('remember'): session.permanent = True if data.get('remember') else False
session.permanent = True
return jsonify({'status': 'ok', 'username': result['username'], 'display_name': result['display_name']}) return jsonify({'status': 'ok', 'username': result['username'], 'display_name': result['display_name']})

View File

@ -422,9 +422,11 @@ class Account{
this.lock(false) this.lock(false)
reject() reject()
}) })
if(!get){
request.setRequestHeader("X-CSRFToken", token)
}
if(obj){ if(obj){
request.setRequestHeader("Content-Type", "application/json;charset=UTF-8") request.setRequestHeader("Content-Type", "application/json;charset=UTF-8")
request.setRequestHeader("X-CSRFToken", token)
request.send(JSON.stringify(obj)) request.send(JSON.stringify(obj))
}else{ }else{
request.send() request.send()