feat: inject WGU PingFed session keepalive script via config - #92
Open
j0mc wants to merge 2 commits into
Open
Conversation
Load the keepalive script (served by academy-oedx-plugin's wgu_session_keepalive view) from SESSION_KEEPALIVE_SCRIPT_URL config. Using defer so the script runs after the document is parsed, since it mounts a modal into document.body and reads localStorage on start. Renders nothing when the config value is empty or unset, so environments that haven't enabled the feature are unaffected.
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.
Overview
Loads the WGU PingFed SSO session keepalive script into the MFE via a new SESSION_KEEPALIVE_SCRIPT_URL MFE config value. The script itself is served by the LMS (academy-oedx-plugin → wgu_session_keepalive view) and is not bundled here.
This approach means keepalive behavior, timings, and copy can be updated via a plugin deploy without requiring an MFE rebuild, and the legacy LMS pages run byte-identical code.
The script tag uses defer (rather than async) because the script mounts a modal into document.body and reads localStorage on startup — it needs a parsed document, but is small enough that it never blocks first paint.
When SESSION_KEEPALIVE_SCRIPT_URL is empty or unset (the LMS publishes an empty string when the feature is disabled), the tag renders nothing, so environments that haven't enabled the feature are unaffected.
To test:
Checklist