You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: preserve FIELDS_STORED_IN_SESSION across OAuth session cleanup #471
Instead of only preserving next, we also preserve FIELDS_STORED_IN_SESSION.
The other PR hits a known issue we've seen in Production, and this hits an issue that might affect openedx-platform?
The following are notes from Claude on this issue. The proposed code change as not been verified:
Param next is the only thing restored, but do_auth() stores more than that before start(). It copies every name in FIELDS_STORED_IN_SESSION (default [], e.g. edx-platform LMS sets ['auth_entry', 'next']) and then separately handles next via redirect_name. Anything else a deployment lists there is flushed by logout() for the same reason next was.
# logout() flushes the session, which also holds what social-auth just stored for this request:
# the sanitized redirect and any FIELDS_STORED_IN_SESSION. Carry only those across.
stored_names = ['next', *self.setting('FIELDS_STORED_IN_SESSION', [])]
stored_values = {name: self.strategy.session_get(name) for name in stored_names}
logout(request)
for name, value in stored_values.items():
if value is not None:
self.strategy.session_set(name, value)
Notes:
next may appear twice if a deployment also lists it in FIELDS_STORED_IN_SESSION. That should be harmless, since the same value is restored twice.
do_auth() writes None for listed fields missing from the request. The is not None guard avoids re-creating those keys, and session_get returns None either way.
The FIELDS_STORED_IN_SESSION could values are still dropped.
For the test, adding a second field (e.g. FIELDS_STORED_IN_SESSION = ['auth_entry'], set to 'login' before do_start()) and asserting it survives would cover the list handling.
Folded into #470 as a second commit (764465b): start() now carries next plus every field in FIELDS_STORED_IN_SESSION across the forced logout, with the existing test extended to cover an auth_entry field.
One note for the record: no current EdXOAuth2 consumer sets FIELDS_STORED_IN_SESSION. The LMS does, but it does not log in through this backend, and Studio leaves it empty. So this half is hardening rather than a reproducible production bug today. The PR closes this issue on merge.
Activity
fix: also preserve FIELDS_STORED_IN_SESSION across OAuth session cleanup
djoseph-apphelix commentedon Oct 28, 2026
Folded into #470 as a second commit (764465b):
start()now carriesnextplus every field inFIELDS_STORED_IN_SESSIONacross the forced logout, with the existing test extended to cover anauth_entryfield.One note for the record: no current
EdXOAuth2consumer setsFIELDS_STORED_IN_SESSION. The LMS does, but it does not log in through this backend, and Studio leaves it empty. So this half is hardening rather than a reproducible production bug today. The PR closes this issue on merge.fix: also preserve FIELDS_STORED_IN_SESSION across OAuth session cleanup