RR v7 framework mode subdomain getSession issue

I have 2 apps, a frontend and an API. API has auth instance and frontend has auth client. both different subdomains. I am unsure how to get getSession working in a loader function on my frontend since technically its a server side call...? useSession works but can't get getSession to work. It is working locally which is strange. Both apps deployed on cloudflare workers. Frontend app is using react router v7 framework mode and hono for SSR. This is my loader
export async function loader({ request }: LoaderFunctionArgs) {
const { data: session } = await getSession({
fetchOptions: {
headers: request.headers,
},
});

if (!session) {
throw redirect("/signin");
}
return {
session,
};
}
export async function loader({ request }: LoaderFunctionArgs) {
const { data: session } = await getSession({
fetchOptions: {
headers: request.headers,
},
});

if (!session) {
throw redirect("/signin");
}
return {
session,
};
}
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?