Skip to content

Conversation

@field123
Copy link
Collaborator

@field123 field123 commented Jan 30, 2026

Summary

Change cors() to cors({ origin: true, credentials: true }) on POST /api/v1/projects/:projectId (updateProjectData endpoint).

Problem

  • Commerce Manager sends requests with credentials: 'include' to send cookies
  • The current cors() returns Access-Control-Allow-Origin: * (wildcard)
  • Browsers block wildcard * when credentials are included

Solution

Use cors({ origin: true, credentials: true }) which:

  • Reflects the requesting origin (instead of *)
  • Supports credentials
  • Still allows any origin (doesn't break CLI or other clients)

Change cors() to cors({ origin: true, credentials: true }) on
POST /api/v1/projects/:projectId to support requests with credentials.

This reflects the requesting origin (instead of returning wildcard *)
while still allowing any origin to access the endpoint.
@field123 field123 merged commit 62093a9 into master Jan 30, 2026
4 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.

2 participants