Skip to content

Commit

Permalink
feat: add integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syedsajjadkazmii committed Jan 18, 2024
1 parent 5264501 commit 8115c06
Show file tree
Hide file tree
Showing 3 changed files with 302 additions and 28 deletions.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/safe_sessions/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,10 @@ def process_request(self, request):
are_emails_mismatched = user_session_email is not None and request.user.email != user_session_email
EmailChangeMiddleware._set_session_email_match_custom_attributes(are_emails_mismatched)
if settings.ENFORCE_SESSION_EMAIL_MATCH and are_emails_mismatched:
# Flush the session and mark cookies for deletion.
log.info(
f'EmailChangeMiddleware invalidating session for user: {request.user.id} due to email mismatch.'
)
# Flush the session and mark cookies for deletion.
request.session.flush()
request.user = AnonymousUser()
_mark_cookie_for_deletion(request)
Expand Down
Loading

0 comments on commit 8115c06

Please sign in to comment.