Skip to content

🐛 Fixed "check your email" popup for already-logged-in members clicking checkout buttons#28505

Merged
kevinansfield merged 1 commit into
mainfrom
fix-active-subscriber-checkout-error
Jun 11, 2026
Merged

🐛 Fixed "check your email" popup for already-logged-in members clicking checkout buttons#28505
kevinansfield merged 1 commit into
mainfrom
fix-active-subscriber-checkout-error

Conversation

@kevinansfield

@kevinansfield kevinansfield commented Jun 11, 2026

Copy link
Copy Markdown
Member

closes https://linear.app/ghost/issue/BER-3724/

When a logged-in paid member clicked a paid signup button — e.g. a theme button using a data-portal="signup/{tier}/{cadence}" attribute — the server rejected the checkout with CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION without sending any email, but Portal showed the magic-link confirmation page. Members were told to check their inbox for an email that never arrived.

This was a regression from #28322, which added handling for CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION to support the anonymous offer-signup flow. The magic-link page is only correct in that flow, where the server emails a sign-in link before rejecting the checkout — for authenticated members no email is sent.

Logged-in members now see an error notification explaining they already have an active subscription instead of the misleading "check your email" page. The message reuses the existing translated string from the gift redemption flow, so it's already localised across all supported locales.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 66d05d74-5a6e-4b9c-a591-eaf3441f47c8

📥 Commits

Reviewing files that changed from the base of the PR and between 8ccf87a and a144a45.

📒 Files selected for processing (7)
  • apps/portal/CONTEXT.md
  • apps/portal/package.json
  • apps/portal/src/actions.js
  • apps/portal/src/app.js
  • apps/portal/test/actions.test.ts
  • apps/portal/test/signup-flow.test.js
  • ghost/i18n/locales/context.json
✅ Files skipped from review due to trivial changes (3)
  • apps/portal/CONTEXT.md
  • ghost/i18n/locales/context.json
  • apps/portal/package.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/portal/src/actions.js
  • apps/portal/src/app.js
  • apps/portal/test/signup-flow.test.js
  • apps/portal/test/actions.test.ts

Walkthrough

This PR updates signup error handling to return a dedicated error (action: 'signup:failed' with a non-auto-hiding popup) for authenticated members when checkout fails with CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION, keeps previous redirect behavior for unauthenticated users, adds unit and signup-flow tests for the authenticated case, moves handleSignupQuery to run after initial setState, updates localization context, and bumps the portal package version.

Possibly related PRs

  • TryGhost/Ghost#28322: Also modifies apps/portal/src/actions.js for the CANNOT_CHECKOUT_WITH_EXISTING_SUBSCRIPTION error case in signup, with corresponding test updates.

Suggested reviewers

  • rob-ghost
  • jonatansberg
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: preventing the misleading 'check your email' popup for logged-in members clicking checkout buttons when they already have an active subscription.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the regression, the user-facing problem, and how the fix addresses it by showing an error notification to logged-in members instead of the misleading magic-link page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-active-subscriber-checkout-error

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevinansfield kevinansfield force-pushed the fix-active-subscriber-checkout-error branch from f5e871b to 42ad855 Compare June 11, 2026 12:59
@kevinansfield kevinansfield changed the title 🐛 Fixed misleading "check your email" popup for already-subscribed members 🐛 Fixed "check your email" popup for already-logged-in members clicking checkout buttons Jun 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42ad855afc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/portal/src/actions.js
@kevinansfield kevinansfield force-pushed the fix-active-subscriber-checkout-error branch 2 times, most recently from 8c959de to e6ec313 Compare June 11, 2026 13:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/portal/test/signup-flow.test.js`:
- Around line 588-612: The test sets window.location.hash but only resets it at
the end, which leaks state on failures; wrap the main test body (the setup call,
waits and assertions that use setup(), ghostApi, utils, popupFrame, and
within(...).queryByText) in a try/finally and move window.location.hash = ''
into the finally block so the hash is always cleared regardless of assertion
failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e98ff2c3-360d-4fe6-bf3c-f8e6e411df7f

📥 Commits

Reviewing files that changed from the base of the PR and between 8c959de and e6ec313.

📒 Files selected for processing (6)
  • apps/portal/package.json
  • apps/portal/src/actions.js
  • apps/portal/src/app.js
  • apps/portal/test/actions.test.ts
  • apps/portal/test/signup-flow.test.js
  • ghost/i18n/locales/context.json
✅ Files skipped from review due to trivial changes (1)
  • apps/portal/package.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • ghost/i18n/locales/context.json
  • apps/portal/test/actions.test.ts
  • apps/portal/src/actions.js

Comment thread apps/portal/test/signup-flow.test.js
@kevinansfield kevinansfield force-pushed the fix-active-subscriber-checkout-error branch from e6ec313 to 8ccf87a Compare June 11, 2026 13:14
…mbers

closes https://linear.app/ghost/issue/BER-3724/show-correct-error-for-active-subscriber-checkout-attempts

When a logged-in paid member clicked a paid signup button, e.g. a theme
button using a `data-portal="signup/{tier}/{cadence}"` attribute, Portal
showed the magic-link confirmation page even though the server rejects
the checkout without sending any email, so members were told to check
their inbox for an email that never arrived.

The magic-link page is only correct for the anonymous flow, where the
server emails a sign-in link before rejecting the checkout. Logged-in
members now see an error notification explaining they already have an
active subscription, reusing the existing translated string from the
gift redemption flow.
@kevinansfield kevinansfield force-pushed the fix-active-subscriber-checkout-error branch from 8ccf87a to a144a45 Compare June 11, 2026 13:21
@kevinansfield kevinansfield enabled auto-merge (squash) June 11, 2026 13:24
@kevinansfield kevinansfield merged commit 43de94a into main Jun 11, 2026
52 checks passed
@kevinansfield kevinansfield deleted the fix-active-subscriber-checkout-error branch June 11, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant