Closed lemon-sandwich closed 3 days ago
I figured it out. I changed
const user_id = req.session?.auth_context?.actor_id
if (!user_id) {
next();
return;
}
to this.
const user_id = req.session?.auth_context?.actor_id?? req.auth_context.actor_id
if (!user_id) {
next();
return;
}
Sometimes, the user_id is stored in session and sometimes in auth_context.
I'm using the productCreated hook and trying to resolve the "loggedInUser" but I'm getting the following error:
I have registered the loggedInUser in the middleware and added it as a middleware in my product routes.
Medusa version: "latest" Node: 20.17.0