Skip to content

Preserve universal Gateway links through organization creation - #1096

Open
softmarshmallow wants to merge 2 commits into
mainfrom
feat/console-universal-links
Open

softmarshmallow wants to merge 2 commits into
mainfrom
feat/console-universal-links

Conversation

@softmarshmallow

@softmarshmallow softmarshmallow commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Allow the exact https://console.grida.co/_/ai-gateway continuation through Grida's existing organization-creation handoff, so callers can return users to the same Gateway entry point after creation.

This is optional continuation support. The current Console organization-creation button returns to /, so this change alone does not alter that flow. Callers must explicitly supply return_to=/_/ai-gateway to use it. The billing alias is outside this PR.

Adds the alias to the finite destination validator and contract fixtures, with a handler test covering successful organization creation and anonymous sign-in continuation. Organization authority and creation behavior remain unchanged; arbitrary redirect URLs and nested/query-bearing aliases remain rejected.

Existing destination and account-handoff fixtures now use explicit test IDs 1 and 2, with 0 retained as an invalid case. Fixtures document that example IDs are synthetic constants.

Validation: 154 focused Console-management/account tests passed locally, including the existing rejection cases. Formatting and lint passed. The original candidate also passed editor TypeScript checks. No database migration or payment changes.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
grida Ready Ready Preview Oct 12, 2026 10:48am UTC
6 Skipped Deployments
Project Deployment Actions Updated
code Ignored Ignored Oct 12, 2026 10:48am UTC
docs Ignored Ignored Preview Oct 12, 2026 10:48am UTC
api Skipped Skipped Oct 12, 2026 10:48am UTC
backgrounds Skipped Skipped Oct 12, 2026 10:48am UTC
blog Skipped Skipped Oct 12, 2026 10:48am UTC
viewer Skipped Skipped Oct 12, 2026 10:48am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – backgrounds October 12, 2026 09:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – viewer October 12, 2026 09:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – blog October 12, 2026 09:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – api October 12, 2026 09:09 Inactive
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccd2d03b-7699-4ce8-921d-9a42c2af4c26

📥 Commits

Reviewing files that changed from the base of the PR and between fa86f26 and 509f52e.


📒 Files selected for processing (3)
  • editor/lib/platform/__fixtures__/console-destinations.json
  • editor/lib/platform/console-account.test.ts
  • editor/lib/platform/console-manage.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.



Walkthrough

The console destination validator now accepts the exact /_/ai-gateway path. Fixtures add valid and invalid destination examples with synthetic organization IDs. Management tests cover authenticated and anonymous organization creation with this return path.

Changes

Universal Gateway alias

Layer / File(s) Summary
Accept the Gateway alias
editor/lib/platform/console-destination.ts, editor/lib/platform/__fixtures__/console-destinations.json
destination accepts /_/ai-gateway when no organization route matches. Fixtures include valid and invalid destinations and use synthetic organization IDs.
Cover management return paths
editor/lib/platform/console-manage.test.ts, editor/lib/platform/console-account.test.ts
Management tests cover authenticated and anonymous organization creation with the Gateway alias as the return path. Test expectations use organization ID 1 instead of 42.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 509f5

This adds an opt-in return path for the Gateway link after organization creation. Other redirect targets are still rejected, and no actionable merge risk was found.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 …
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.
Title check Passed The title clearly summarizes the main change: preserving the Gateway link through organization creation.
Description check Passed The description directly explains the optional /_/ai-gateway continuation, validation changes, tests, and scope limits.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

This branch was successfully deployed

1 active and 4 inactive deployments
Preview – grida — 509f52e8 Deployed Oct 12, 2026 by vercel[bot]
Preview – api — 509f52e8 Deployed Oct 12, 2026 by vercel[bot]
Preview – backgrounds — 509f52e8 Deployed Oct 12, 2026 by vercel[bot]
Preview – viewer — 509f52e8 Deployed Oct 12, 2026 by vercel[bot]
Preview – blog — 509f52e8 Deployed Oct 12, 2026 by vercel[bot]
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.

1 participant