mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-01-28 02:14:37 +01:00
Invalidate any previously cached attributes on user login
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
|
||||
from flask import session
|
||||
|
||||
from CTFd.cache import clear_user_session
|
||||
from CTFd.exceptions import UserNotFoundException, UserTokenExpiredException
|
||||
from CTFd.models import UserTokens, db
|
||||
from CTFd.utils.encoding import hexencode
|
||||
@@ -15,6 +16,9 @@ def login_user(user):
|
||||
session["email"] = user.email
|
||||
session["nonce"] = generate_nonce()
|
||||
|
||||
# Clear out any currently cached user attributes
|
||||
clear_user_session(user_id=user.id)
|
||||
|
||||
|
||||
def logout_user():
|
||||
session.clear()
|
||||
|
||||
Reference in New Issue
Block a user