mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-20 12:20:47 +08:00
Make logout view do nothing if the user is already logged out
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user