blitz.js: ctx.session is undefined in login mutation on deployment (works locally)

249 Views Asked by At

In app/auth/mutations/login the ctx is an empty object ({}), thus this line:

await ctx.session.$create({ userId: user.id, role: user.role as Role });

trhows an Error: Cannot read property '$create' of undefined.

Only happens on vercel deployment, works fine on localhost.

0

There are 0 best solutions below