Skip to content

fix: use configured site URL for copy, share, and approval links - #16

Merged
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
slegarraga:fix/copy-link-use-site-url
Aug 6, 2026
Merged

fix: use configured site URL for copy, share, and approval links#16
royalpinto007 merged 2 commits into
AgentPostmortem:mainfrom
slegarraga:fix/copy-link-use-site-url

Conversation

@slegarraga

Copy link
Copy Markdown
Contributor

Replaces hardcoded https://agentpostmortem.com URLs with getSiteUrl() in user-facing and admin flows.

  • Copy Link now respects NEXT_PUBLIC_SITE_URL / NEXT_PUBLIC_APP_URL during local development.
  • The X share link uses the same configured origin.
  • Approval emails use the configured origin for the case URL.

Verified with npm run lint, npx tsc --noEmit, Prettier, and the test suite.

Closes #2

@royalpinto007

Copy link
Copy Markdown
Contributor

Great second contribution, thank you again!

This is the right call in all three spots. I especially like that you caught the admin approval email in app/api/admin/posts/[id]/route.ts and the X share link, not just the copy button the issue mentioned. Those would have kept sending people to the hardcoded origin.

Worth noting for anyone reading later: getSiteUrl() only reads NEXT_PUBLIC_* vars, which Next inlines at build time, so it works correctly inside the client CopyLinkButton and still falls back to production when nothing is configured.

All checks green. Merging.

@royalpinto007
royalpinto007 merged commit 6cd553e into AgentPostmortem:main Aug 6, 2026
3 checks passed
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.

Copy Link button hardcodes the production URL instead of using getSiteUrl()

2 participants