Skip to content

feat: wire FEEDBACK_LOGIN_URL for feedback popup login - #134

Draft
zamanafzal wants to merge 1 commit into
mainfrom
zafzal/11629-feedback-login-url
Draft

feat: wire FEEDBACK_LOGIN_URL for feedback popup login#134
zamanafzal wants to merge 1 commit into
mainfrom
zafzal/11629-feedback-login-url

Conversation

@zamanafzal

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

  • mitodl/hq#11629 (per-block content feedback)
  • Companion to smoot-design #246 (popup login + auto-submit)

Description (What does it do?)

Wires a new FEEDBACK_LOGIN_URL env var through to the smoot-design feedback drawer bundle.

A courseware-only learner (logged into courses.<env>.learn.mit.edu but not MIT Learn) has no mit-learn/APISIX session, so their feedback POST is anonymous and 403s. smoot-design #246 adds an optional popup-login + auto-submit flow that activates only when the bundle receives a loginUrl. This PR supplies it:

  • feedbackBundle.js — export LOGIN_URL from process.env.FEEDBACK_LOGIN_URL (undefined when unset).
  • FeedbackDrawerSlot.jsx — pass loginUrl: LOGIN_URL into module.init(...).

Leaving FEEDBACK_LOGIN_URL unset preserves today's direct-POST behavior, so this is safe to merge ahead of enabling the flow per-environment.

Screenshots (if appropriate):

n/a (config wiring).

How can this be tested?

  • Set FEEDBACK_LOGIN_URL=<mit-learn>/login (e.g. https://api.rc.learn.mit.edu/login) in the Learning MFE env alongside the existing FEEDBACK_* vars, rebuild, and open the feedback drawer while not logged into MIT Learn: Submit opens a login popup and auto-sends the drafted feedback once the session exists.
  • With FEEDBACK_LOGIN_URL unset, the drawer submits directly as before.

Additional Context

Requires smoot-design #246 to be published and the bundle bumped. Root cause (identity, not CSRF) is documented in the content-feedback skill (references/auth-and-identity.md).

Courseware-only learners have no mit-learn session, so their feedback POST is
anonymous and 403s. Expose the new FEEDBACK_LOGIN_URL env var and pass it to the
smoot-design bundle as `loginUrl`, enabling the popup-login + auto-submit flow.
Leaving the var unset keeps the previous direct-POST behavior.
@zamanafzal

Copy link
Copy Markdown
Contributor Author

Flow diagram for the popup-login + auto-submit behavior this env var enables lives on the smoot-design PR: mitodl/smoot-design#246 (comment). This PR only supplies FEEDBACK_LOGIN_URLloginUrl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants