Skip to content

feat: preserve the activation next URL for all learners - #456

Merged
pwnage101 merged 1 commit into
release-ulmofrom
pwnage101/ENT-11816-account-activation
Sep 9, 2026
Merged

feat: preserve the activation next URL for all learners#456
pwnage101 merged 1 commit into
release-ulmofrom
pwnage101/ENT-11816-account-activation

Conversation

@pwnage101

@pwnage101 pwnage101 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Rework activate_account() so the post-activation destination is no longer sensitive to enterprise membership, and consistently redirects unauthenticated learners to the login page in a way that preserves the next URL. Furthermore, this commit expands the cases where the activation CTA cookie is cleared, so that it's always cleared after successful activation.

Prior to this commit, there were three user stories which seemed wrong and had possibly misleading behavior:

  1. Already-logged-in, non-enterprise learners trying to click an "activate account" link containing a next URL would get dropped into the learner dashboard despite a next URL being specified.
  2. Logged-out learners on a platform with the AuthN MFE disabled (still a supported configuration) trying to click an "activate account" link containing a next URL would get dropped into the learner dashboard despite a next URL being specified.
  3. Logged-out learners on a platform with the AuthN MFE enabled may see an activation CTA (reminder message to activate) even after successful activation and login.

In user stories 1-2, the next URL has been carefully supplied by the client, but subsequently ignored. If the intended behavior is to terminate on the dashboard, clients should NOT specify a next query parameter on the activate_account link.

In user story 3, the stray activation CTA may seem nagging and annoying since activation was already attempted and succeeded.

ENT-11816

@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11816-account-activation branch from 0a42578 to 47e0e43 Compare September 3, 2026 22:07
Rework activate_account() so the post-activation destination is no
longer sensitive to enterprise membership, and consistently redirects
unauthenticated learners to the login page in a way that preserves the
`next` URL.  Furthermore, this commit expands the cases where the
activation CTA cookie is cleared, so that it's *always* cleared after
successful activation.

Prior to this commit, there were three user stories which seemed wrong and
had possibly misleading behavior:

1. Already-logged-in, non-enterprise learners trying to click an
   "activate account" link containing a `next` URL would get dropped
   into the learner dashboard despite a `next` URL being specified.
2. Logged-out learners on a platform with the AuthN MFE disabled
   (still a supported configuration) trying to click an "activate
   account" link containing a `next` URL would get dropped into the
   learner dashboard despite a `next` URL being specified.
3. Logged-out learners on a platform with the AuthN MFE enabled may
   see an activation CTA (reminder message to activate) even after
   successful activation and login.

In user stories 1-2, the `next` URL has been carefully supplied by the
client, but subsequently ignored.  If the intended behavior is to
terminate on the dashboard, clients should NOT specify a `next` query
parameter on the activate_account link.

In user story 3, the stray activation CTA may seem nagging and annoying
since activation was already attempted and succeeded.

ENT-11816
@pwnage101
pwnage101 force-pushed the pwnage101/ENT-11816-account-activation branch from 47e0e43 to 24c7351 Compare September 8, 2026 15:46
@pwnage101 pwnage101 closed this Sep 8, 2026
@pwnage101 pwnage101 reopened this Sep 8, 2026
@pwnage101
pwnage101 marked this pull request as ready for review September 8, 2026 22:04
@pwnage101 pwnage101 closed this Sep 8, 2026
@pwnage101 pwnage101 reopened this Sep 8, 2026
@pwnage101
pwnage101 requested a balanced review from Copilot September 8, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Explicit /dashboard destinations remain lost when a custom post-login default is configured.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Preserves activation destinations across authentication flows and clears stale activation CTA cookies.

Changes:

  • Routes unauthenticated learners through login while retaining safe next URLs.
  • Removes enterprise-only redirect behavior.
  • Adds redirect and cookie-clearing tests.
File summaries
File Description
common/djangoapps/student/views/management.py Updates post-activation redirects and cookie cleanup.
common/djangoapps/student/tests/test_activate_account.py Expands coverage across authentication configurations.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread common/djangoapps/student/views/management.py

@subhashree-sahu31 subhashree-sahu31 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code changes LGTM 🚀
please resolve the open Copilot comment (unauthenticated next=/dashboard being dropped) with either a fix or a reply before merging.

@pwnage101

Copy link
Copy Markdown
Member Author

Since I neither altered nor introduced the /dashboard dropping behavior, I'm going to opt to leave its "fix" for a separate PR and consider it out-of-scope for my current task.

@pwnage101
pwnage101 merged commit f1d037b into release-ulmo Sep 9, 2026
222 of 271 checks passed
@pwnage101
pwnage101 deleted the pwnage101/ENT-11816-account-activation branch September 9, 2026 20:58
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.

4 participants