Closed nak1b closed 2 months ago
Hello, @nak1b and thank you for opening this issue. After testing this locally on our side with 2 different Google profiles, we didn't experience this issue. A few suggestions to see if we can narrow down what is causing this:
Verify that the lastAuthUser within each profile contains a different value (rather than the same across both sessions) to ensure that the ID tokens are not being shared between the two Chrome profiles. This can be done by logging the following key within the cookieStore: CognitoIdentityServiceProvider.<your_user_pool_client_id>.LastAuthUser
Can you confirm if the request sent to the server from both profiles contains different username?
If the above both show different results, can you then double check that the Identity Pool ID being used when configuring Amplify is the correct one you'd expected? Asking this because typically the error mentioned in this issue is thrown when the wrong Identity Pool ID is being used.
Is there a specific reason that you're looking to use the generic adapter instead of the adapter-nextjs (see here)?
@cwomack Thank you for taking the time to comment and test this issue. We recently created a new Amplify project on AWS, but our repository was still using the old configurations. Initially, we thought that simply updating the aws-exports
file would suffice. However, we had to replace the entire Amplify folder with the new project using amplify pull
to resolve the issue.
Regarding your question about using a generic adapter, I was following the guide linked here to set it up. I will also review the Next.js adapter to see if I can get it to work.
@nak1b, did you get a chance to review the adapter and see if it resolves the issue? Just wanted to check in and see if there's anything still blocking you. Thanks!
@cwomack we are still seeing incremental issue with "Logins Don't Match" I will work on replacing the adaptor and provide update on my findings. Thank You.
@nak1b, just wanted to check in and see if you had a chance to test the adapter. And when you mention that you're experiencing this incrementally with your users, is this only happening with a certain subset/specific provider? Can you double check to ensure that anywhere you're importing your config, you've updated it to use the most recent changes to ensure the identity pool and backend resources are aligned.
Let us know if you're still experiencing this!
@cwomack We updated the adaptor last week and were testing the new next adaptor and we are not seeing this issue anymore. Thanks for your help.
Before opening, please confirm:
JavaScript Framework
Next.js
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
I have an application where users can log in through Google. However, I'm encountering an issue when attempting to retrieve user information on the server side. While the login works fine for one profile, it returns an error for another. This happens only when trying to access same application with different users on different google chrome profile.
Error:
Expected behavior
Profile 1: The server-side function should return the correct user information without any errors, similar to how it behaves on the client side.
Profile 2: The application should continue to work as expected, with the user information retrieved correctly on both the client and server sides.
Reproduction steps
Login with Profile 1
Use Google to log in with user1@gmail.com on Google Profile 1.
Login with Profile 2
Use Google to log in with user2@gmail.com on Google Profile 2. Retrieve User Info on Server Side
On Google Profile 1, attempting to fetch user data server-side results in the following error:
Fetching user info on client side for user on both Google Profile 1 and 2 works correctly.
Code Snippet
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