Skip to content

Redirect Get Feedback to the canonical subscript.to origin - #4

Merged
lsegal merged 2 commits into
mainfrom
fix/issue-2-feedback-redirect-origin
Oct 3, 2026
Merged

lsegal merged 2 commits into
mainfrom
fix/issue-2-feedback-redirect-origin

Conversation

@lsegal

@lsegal lsegal commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Get Feedback redirected users to write.subscript.to after uploading their draft, where SSO login fails. It now always lands on the canonical Subscript site (subscript.to).

Root cause

getFeedback in app/src/App.tsx POSTs to the relative path /write/feedback and then called window.location.assign(result.redirect_url) directly. When the editor is served from write.subscript.to, a relative redirect_url (or one the server built from the request host) resolves to write.subscript.to, not subscript.to.

Change

  • New helper feedbackRedirectUrl (app/src/lib/feedback.ts) resolves the returned redirect against the configured Subscript homepage (config.homepage, default https://subscript.to):
    • relative URLs resolve against the homepage origin;
    • absolute URLs pointing at the editor's own host are moved onto the homepage origin (path, query, and hash preserved);
    • URLs on any other origin are left alone, and nothing changes when the editor is embedded on the homepage itself.
  • getFeedback uses the helper before navigating.

User impact

After clicking Get Feedback on write.subscript.to, users land on subscript.to, where SSO login works.

Tests

  • Added app/src/lib/feedback.test.ts covering relative, editor-host, foreign-origin, and embedded-on-homepage redirects.
  • pnpm run lint and pnpm run test (13 files, 41 tests) pass locally.

Notes

  • No changelog entry: the project has no changelog.
  • No screenshots: the change only affects the navigation target, not any rendered UI.

Closes #2

Agents: claude-code (claude-opus-5-5)

lsegal and others added 2 commits October 3, 2026 14:12
@lsegal
lsegal marked this pull request as ready for review October 3, 2026 21:13
@lsegal
lsegal merged commit 83ebd92 into main Oct 3, 2026
1 of 2 checks passed
@lsegal
lsegal deleted the fix/issue-2-feedback-redirect-origin branch October 3, 2026 21:15
@lsegal

lsegal commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Manual verification

CI can't cover these because they need the deployed site and a real Subscript account.

  • Once this is deployed, open https://write.subscript.to while signed out of Subscript, write a short draft, and click Get Feedback. The upload should finish and the browser should land on a https://subscript.to/... URL, not write.subscript.to.
  • Sign in through SSO on that page. Login should succeed and you should reach the feedback flow for the uploaded draft.
  • Repeat while already signed in to Subscript. The redirect should go straight to the subscript.to feedback page.

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.

Get Feedback redirects to write.subscript.to instead of subscript.to, breaking SSO login

1 participant