Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #217 from swarmer/logout-fix
Browse files Browse the repository at this point in the history
Make logout view do nothing if the user is already logged out
  • Loading branch information
Matt Wright committed Feb 4, 2014
2 parents 8e8d581 + 09f6f64 commit 0268a2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flask_security/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def login():
**_ctx('login'))


@login_required
def logout():
"""View function which handles a logout request."""

logout_user()
if current_user.is_authenticated():
logout_user()

return redirect(request.args.get('next', None) or
get_url(_security.post_logout_view))
Expand Down

0 comments on commit 0268a2d

Please sign in to comment.