Make key removal from session more solid
Do not die a horrible death if the key you are attempting to remove from the session upon logout doesn't exist. Attempt at fixing #556
This commit is contained in:
parent
4583128c02
commit
e77efde503
1 changed files with 3 additions and 2 deletions
|
|
@ -235,8 +235,9 @@ def login():
|
|||
@restricted_access
|
||||
def logout():
|
||||
# Remove session keys set by Flask-Principal
|
||||
for key in ('identity.id', 'identity.auth_type'):
|
||||
del session[key]
|
||||
for key in ('identity.id', 'identity.name', 'identity.auth_type'):
|
||||
if key in session:
|
||||
del session[key]
|
||||
identity_changed.send(current_app._get_current_object(), identity=AnonymousIdentity())
|
||||
|
||||
logout_user()
|
||||
|
|
|
|||
Loading…
Reference in a new issue