Session cookie not set when deployed in production on Amplify Hosting #5885
Unanswered
davideicardi
asked this question in
Help
Replies: 1 comment 1 reply
-
Any solution to this? I noticed similar issue. I am using Next auth v5 deployed to amplify but the deployment was successful, static page works ok but the side that are dependent on session does not work |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have tried to deploy a simple Next-Auth.js app (v4.17, Next.js 13.0.4) to Amplify Hosting.
I need to integrate with AWS Cognito for authentication. In localhost everything works fine. But when deployed to Amplify it seems that the session cookie is not set, and so the user is never authenticated.
I receive a redirect from cognito to my app with an authorization code, but the callback doesn't generate the correct set-cookie instruction. It looks like the
callbacks.session
is never called. I don't see any error in the browser console or in Cloudwatch.My
[...nextauth].ts
code:I have configured
NEXTAUTH_URL
and all environment variables in Amplify.Any idea? I don't know how to debug ...
Beta Was this translation helpful? Give feedback.
All reactions