hiyaryan / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
https://thecdj.app
3 stars 0 forks source link

HTTPS and cors same origin policy blocking access to backend. #28

Closed hiyaryan closed 8 months ago

hiyaryan commented 9 months ago

Attempting to make API requests from the vite frontend to the express backend does not work even after becoming a local CA and creating a certificate that is loaded onto the frontend. Originally this issue was thought to be a cors issue since the frontend is not the same origin, but even after granting access on the server side the SOP error (see below) still persists.

MDN documentation suggest the issue may lie in the certificate being invalid. This might be the issue over cors not being setup correctly, however, either of these or both may be the issue. If this issue isn't resolved relatively easily over the next few days it may be better to develop over HTTP instead, or maybe set vite to HTTP and keep the server using HTTPS (since you are already using private API keys, you should keep development on secure local area networks.)

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://192.168.50.157:8443/access/login. (Reason: CORS request did not succeed). Status code: (null)