Add configurable next_url for OpenEdX Hawthorn login/register redirects#2795
Open
igobranco wants to merge 1 commit intoopenfun:masterfrom
Open
Add configurable next_url for OpenEdX Hawthorn login/register redirects#2795igobranco wants to merge 1 commit intoopenfun:masterfrom
next_url for OpenEdX Hawthorn login/register redirects#2795igobranco wants to merge 1 commit intoopenfun:masterfrom
Conversation
Add support for a configurable `JS_NEXT_URL` setting per LMS backend that controls the prefix used in the `?next=` parameter during login/register redirects in the OpenEdX Hawthorn API. Previously the prefix was hardcoded to "richie". It can now be set per backend via `JS_NEXT_URL` in `RICHIE_LMS_BACKENDS` settings and is exposed to the frontend through the context processor as `next_url` on each LMS backend entry.
a163cad to
efa606c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OpenEdX Hawthorn API previously hardcoded the
richieprefix in the?next=query parameter used during login and register redirects(e.g.
?next=richie/courses/...). This prefix is used by OpenEdX's Nginxconfiguration to identify that the redirect target belongs to the Richie
application.
This PR makes that prefix configurable per LMS backend, allowing sites with
custom Nginx routing rules to set their own prefix.
This allows to have multiple Richie sites connected to the same Open edX LMS.
And the Open edX redirects to the right Richie site during login/register redirects.
Changes
Backend
JS_NEXT_URLoptional setting toRICHIE_LMS_BACKENDSconfiguration(defaulting to
"richie"if not set)FrontendContextProcessor.get_lms_context()to includenext_urlin the frontend context when
JS_NEXT_URLis configuredJS_NEXT_URL, presentJS_NEXT_URL, and mixed multi-backend scenariosFrontend
nextURLoption toAPIOptionstypenext_urlfield toLMSBackendandAuthenticationBackendtypes
OpenEdxHawthornApiInterfaceto useoptions?.nextURL(falling back to
"richie") for login/register redirectsLMSHandlerto passnext_urlfrom the backend config through toOpenEdxHawthornApiInterfacenext_urlbehavior in both the HawthornAPI and the LMS handler
How to configure