Skip to content

Conversation

ChristopherChudzicki
Copy link
Contributor

@ChristopherChudzicki ChristopherChudzicki commented Oct 6, 2025

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/8742

Description (What does it do?)

Changes the enrollment code URL to /enrollmentcode/[code] and adds a redirect for it.

How can this be tested?

  1. Prerequisites:
  2. Get an enrollment code for your contract in mitxonline via ./manage.py b2b_list contracts --codes <contract ID>
  3. As a logged-in user not in the org yet, or as an anon user if you want to create an account, visit /enrollmentcode/[uuid]; you should be redirected to your org dashboard.
  4. Using a real or fake enrollment code, visit /attach/[some-real-or-fake-code]. You should be redirected to /enrollmentcode/[real-or-fake-code].

Copy link
Contributor

@jonkafton jonkafton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The Next.js docs suggests to use a permanent flag. This results in a 308, though 301 is fine for our purposes as a front end GET route (any other reason?).

Fastly should cache the 301 in the absence of any header instruction not to, though the Next.js config won't let us set an explicit max-age unfortunately.

@ChristopherChudzicki ChristopherChudzicki merged commit 1382330 into main Oct 7, 2025
13 checks passed
@ChristopherChudzicki ChristopherChudzicki deleted the cc/enrollmentcode branch October 7, 2025 18:45
This was referenced Oct 7, 2025
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