fix: Logout from already logged out
This commit is contained in:
parent
65227f650c
commit
8a44d48441
2
main.py
2
main.py
@ -355,6 +355,8 @@ def logout():
|
|||||||
resp = make_response(redirect('/'))
|
resp = make_response(redirect('/'))
|
||||||
resp.set_cookie('auth', '', expires=0)
|
resp.set_cookie('auth', '', expires=0)
|
||||||
|
|
||||||
|
if 'auth' not in request.cookies:
|
||||||
|
return resp
|
||||||
cookies = [i for i in cookies if i['cookie'] != request.cookies['auth']]
|
cookies = [i for i in cookies if i['cookie'] != request.cookies['auth']]
|
||||||
with open('cookies.json', 'w') as file:
|
with open('cookies.json', 'w') as file:
|
||||||
json.dump(cookies, file)
|
json.dump(cookies, file)
|
||||||
|
Loading…
Reference in New Issue
Block a user