Skip to content

Fix referral code links on preview deployments - #235

Closed
meteop-x wants to merge 1 commit into
profullstack:masterfrom
meteop-x:codex/referral-code-origin
Closed

Fix referral code links on preview deployments#235
meteop-x wants to merge 1 commit into
profullstack:masterfrom
meteop-x:codex/referral-code-origin

Conversation

@meteop-x

Copy link
Copy Markdown
Contributor

Summary

  • Build /api/referrals/code links from NEXT_PUBLIC_APP_URL when configured, otherwise from the current request origin.
  • URL-encode the referral code before putting it into the invite link.
  • Add regression coverage for preview-origin links and configured app URL links.

Fixes #127.

uGig gig: https://ugig.net/gigs/abd6b2a0-e728-48cf-a46f-f99e419ed94e

Validation

  • node_modules\.bin\vitest.cmd run src/app/api/referrals/code/route.test.ts
  • node_modules\.bin\tsc.cmd --noEmit
  • node_modules\.bin\prettier.cmd --check src/app/api/referrals/code/route.ts src/app/api/referrals/code/route.test.ts
  • git diff --check

Note: corepack pnpm install --frozen-lockfile populated dependencies, but the repo postinstall script fails on this Windows shell because it invokes bare pnpm and Unix true; direct local binaries were used for validation after install.

@meteop-x

Copy link
Copy Markdown
Contributor Author

Closing this to avoid a duplicate submission: PR #128 already covers issue #127. I'll move to a non-overlapping bug instead.

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.

bug: referral code API returns production invite links on non-production origins

1 participant