Fixed infinite recursion.

This commit is contained in:
Sybren A. Stüvel 2017-08-29 12:31:52 +02:00
parent bdd603fb17
commit 6825b8bf74

View File

@ -212,8 +212,14 @@ def force_logout_user():
from flask import g
flask_login.logout_user()
g.current_user = flask_login.current_user._get_current_object()
# Force the current user to be the anonymous user. Calling
# flask_login.logout_user() here would cause infinite recursion, because
# that calls _load_user(), which in turn tries to validate the current
# token, which in turn starts by calling force_logout_user() just to be
# safe.
anon_user = AnonymousUser()
flask_login.current_user = anon_user
g.current_user = anon_user
def get_blender_id_oauth_token():