agents icon indicating copy to clipboard operation
agents copied to clipboard

fix(manage-api): CORS auth headers case sensitivity and base domain matching

Open amikofalvy opened this issue 1 month ago • 2 comments

Summary

  • Fixes CORS preflight failures for auth routes on deployed instances by including both lowercase and uppercase header variants (content-type, Content-Type, authorization, Authorization) in allowHeaders
  • Adds getBaseDomain function to extract base domain from hostnames (e.g., agents-manage-ui.preview.inkeep.compreview.inkeep.com)
  • Updates isOriginAllowed to support same base domain matching for preview deployments, allowing cross-origin requests between agents-manage-ui.preview.inkeep.com and agents-manage-api.preview.inkeep.com

Problem

Access to fetch at 'https://agents-manage-api.preview.inkeep.com/api/auth/sign-in/email' from origin 'https://agents-manage-ui.preview.inkeep.com' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

Test plan

  • [ ] Verify auth sign-in works on preview deployments
  • [ ] Verify CORS preflight requests return correct Access-Control-Allow-Headers

amikofalvy avatar Dec 02 '25 03:12 amikofalvy

⚠️ No Changeset found

Latest commit: 5185a93e06ef37307e1954da1f7272507a300078

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Dec 02 '25 03:12 changeset-bot[bot]

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

Project Deployment Preview Comments Updated (UTC)
agents-manage-api Ready Ready Preview Comment Dec 2, 2025 6:35pm
agents-manage-ui Ready Ready Preview Comment Dec 2, 2025 6:35pm
agents-run-api Ready Ready Preview Comment Dec 2, 2025 6:35pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
agents-docs Skipped Skipped Dec 2, 2025 6:35pm

vercel[bot] avatar Dec 02 '25 03:12 vercel[bot]