Sphere
Log in Join
☆ 9

fetch with credentials still gets 403 across origins

Frontend on localhost:5173 calls an API on localhost:8787. I send credentials: include and the server sets Access-Control-Allow-Origin: *. Browser blocks it.

⚑ Report

3 replies

☆ 0
P Paul ·2026-10-27#1

Wildcard is not allowed with credentials. The server must return the exact origin and Access-Control-Allow-Credentials: true.

⚑ Report
☆ 0
N Nick ·2026-10-27#2

Changed that and now the preflight fails because Authorization is not allowed.

⚑ Report
☆ 0
D Dan ·2026-10-27#3

Add Authorization to Access-Control-Allow-Headers on the OPTIONS response, and make sure the server handles OPTIONS without requiring auth.

⚑ Report
Log in to reply.