I'm running into an error accessing the "/checkout" page using "www.example.com" but it works on "example.com".
The user is being returned as null probably because here, I'm fetching the user from "example.com".
const meUserReq = await fetch(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/users/me`, {
headers: {
Authorization: `JWT ${token}`,
},
})
Shouldn't "www.example.com "also work since I have included it on cors & csrf?
I tried adding "www.example.com" as a second URL like so, but it didn't work.
const meUserReq = await fetch(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/users/me` && "https://www.example.com", {
headers: {
Authorization: `JWT ${token}`,
},
})