Merge pull request #1383 from CTFd/fix-invalid-session-situation

* Fix an issue where session id no longer exists but the server thinks the user is still authed
mark-2.4.1
Kevin Chung 2020-05-05 22:18:31 -04:00 committed by GitHub
commit 6a785f1095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -202,6 +202,7 @@ def init_request_processors(app):
except (InvalidRequestError, IntegrityError): except (InvalidRequestError, IntegrityError):
db.session.rollback() db.session.rollback()
logout_user() logout_user()
else:
clear_user_recent_ips(user_id=session["id"]) clear_user_recent_ips(user_id=session["id"])
@app.before_request @app.before_request