-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting undefined currentUserSession while running runWithAmplifyServerContext on server side #13767
Comments
Hi @prabhat-sunai thank you for opening this issue. Since you can only reproduce this issue locally, could you do the following for further investigation?
Also are you using Safari for testing locally? |
The cookie store contains auth tokens after signing in and it is also present in network requests that were sent to local Next JS server. Also, the client side query is fine and access token is being shown in client side query. I also checked the cookie object from next/header and all the tokens are shown there. I am using Google Chrome for testing locally |
Thanks for providing more information @prabhat-sunai I have no clue what's happening here reading your description if the cookies presents in all the locations. When you are saying:
Did Also, is it possible to create a minimal reproducing app so I can also help inspect? |
Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue. Thank you! |
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
While running runWithAmplifyServerContext on the server side, it doesn't provide me with the current user session, even when the user is logged in. However, the code works fine when deployed but the issue occurs on my localhost.
Expected behavior
It should give user access token and id token
Reproduction steps
add this code to server side function
npm run dev
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: