I am trying to use next-auth v4 in middleware. I have common setup for authentication (credentials provider). When user is authenticated i am getting it from token in middleware. Locally works pretty fine in dev mode and in prod mode (build & start). But on production in AWS Amplify I am getting req: { nextauth: {token: null }}
I haven’t found any solution. I am expecting production version to work exactly same as it works locally.