Skip to content

fix(cors): allow credentialed requests on /api/invitations/preview#30

Merged
alejandro-runner merged 1 commit intosynvya-stagingfrom
fix/invitations-preview-cors
Apr 17, 2026
Merged

fix(cors): allow credentialed requests on /api/invitations/preview#30
alejandro-runner merged 1 commit intosynvya-stagingfrom
fix/invitations-preview-cors

Conversation

@alejandro-runner
Copy link
Copy Markdown
Member

Summary

  • Switches /api/invitations/preview from public_cors (wildcard *, allow_credentials: false) to auth_cors (echoes allowed origin, allow_credentials: true) so browser clients whose shared fetch wrapper defaults to credentials: "include" no longer fail preflight.
  • Endpoint remains unauthenticated — it's still token-gated via the URL.

Fixes #28

Test plan

  • OPTIONS preflight from an ALLOWED_ORIGINS origin with Access-Control-Request-Headers: content-type returns Access-Control-Allow-Origin: <that origin> and Access-Control-Allow-Credentials: true.
  • OPTIONS preflight from a non-allowed origin is rejected.
  • Existing callers without cookies continue to work.

🤖 Generated with Claude Code

Move the invitation preview route from public_cors (wildcard, no
credentials) to auth_cors (origin-echoing, credentials allowed) so
browser clients with a shared credentialed fetch wrapper don't get
blocked at preflight. The endpoint remains unauthenticated and
token-gated in the URL.

Fixes #28

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alejandro-runner alejandro-runner merged commit a557984 into synvya-staging Apr 17, 2026
@alejandro-runner alejandro-runner deleted the fix/invitations-preview-cors branch April 17, 2026 22:10
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.

Allow credentialed CORS on /api/invitations/preview

1 participant