session?.set("user", { _link: record.id }); but const userId = session.get("user"); is null
this is sign-up.ts
this is routes
but in routes it is null ,How can I get the userId? Is getting it from the frontend the only way?
4 Replies
Hello,
The route possibly doesn't have the same context. Where are you calling the route from?
I'm calling it from the frontend.
Are you using useFetch or another method?
If you're using useFetch or api.fetch, we add context to the call, otherwise we can't
Sorry, also, which frontend? Theme app extension or embedded admin UI?
If its from a theme app extension, there's nothing that we can do and you should consider reading this thread:
https://discord.com/channels/836317518595096598/1323272209694851082/1323343266967453708
If it's from the admin UI, why aren't you using a global action instead?
neither app extension or embedded admin UI, is a Web app , use tailwind
tks,Antonine, The handleGenerateTitle function has been updated to use api.fetch instead of the standard fetch. This change is working correctly.
before
and now