React app No 'Access-Control-Allow-Origin' header is present on the requested resource. #173
-
My React app is getting CORS error when I try to use a baseUrl of http://localhost:8091/fpt. I check the server and see that the server return 200 as indicated in the log line below.
The React App works okay for the default tenant at http://localhost:8091. This is the error log from the Chrome, I also tried with Safari as well but same error. Acess to fetch at 'http://localhost:8091/fpt/.well-known/openid-configuration' from origin 'http://localhost:3010' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. When I try to use a Chrome extension to disable cors. It works okay. My React App is running at localhost:3010 and my fief container is also running with React code:
REACT_APP_FIEF_BASE_URL=http://localhost:8091/fpt |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Well, it seems to be a bug from Fief 😅 Actually, for authentication routes, CORS is allowed for every origins, but limited to some paths: Lines 42 to 49 in 8430b2e Clearly, the regex won't match routes with a sub-tenant. I'll fix this ASAP. |
Beta Was this translation helpful? Give feedback.
Fixed since
0.24.1