Skip to content

feat: inject WGU PingFed session keepalive script via config - #92

Open
j0mc wants to merge 2 commits into
redwood.masterfrom
feat/session-keepalive
Open

feat: inject WGU PingFed session keepalive script via config#92
j0mc wants to merge 2 commits into
redwood.masterfrom
feat/session-keepalive

Conversation

@j0mc

@j0mc j0mc commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Enable the keepalive feature in the LMS site config (SESSION_KEEPALIVE_SCRIPT_URL pointing to the keepalive script endpoint).
  2. Load a course page in the MFE and confirm the keepalive modal appears as expected.
  3. With the config value empty/unset, confirm no script tag is injected and no errors appear in the console.

Checklist

  • Code is correctly formatted and linted
  • Unit tests are updated and are passing
  • PR title follows conventional commits (https://www.conventionalcommits.org/en/v1.0.0/#summary)
  • PR Title aligns to Semantic-Release supported prefixes
  • Check for unused files
  • Check work before asking for reviewers
  • Fix any linting errors
  • SECURITY: No secrets were committed to the repo
  • COMPLIANCE: Committed code is not proprietary and adheres to Open Source licensing

j0mc added 2 commits August 24, 2026 11:47
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.
@j0mc j0mc changed the title Feat/session keepalive feat: inject WGU PingFed session keepalive script via config Aug 24, 2026
@j0mc
j0mc changed the base branch from main to redwood.master August 24, 2026 19:41
@j0mc
j0mc requested a review from rodmgwgu August 24, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant