SPA calling session/whoami: CORS problem #1217
-
Hi, I'm trying to get a React app working with the browser flows. User registration is successful and returns a ory_kratos_session cookie. Now I want to fetch |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @zn8nz, I had a similar issue. const [userIdentity, setUserIdentity] = useState();
useEffect(() => {
fetch("http://127.0.0.1:4433/sessions/whoami", {credentials: "include"})
.then(response => response.json())
.then(data => {
setUserIdentity(data);
})
}, []); Also, be sure that the ORY cookies are still stored in the browser when calling the endpoint and that you have configured the
|
Beta Was this translation helpful? Give feedback.
Hi @zn8nz, I had a similar issue.
Can you try this call and see if it works for you?
Also, be sure that the ORY cookies are still stored in the browser when calling the endpoint and that you have configured the
allowed_origins
field correctly in kratos.yml.