When I log in with a user from my user pool from the AWS amplify component, the login completes successfully. Even my onAuthStateChange callback is called properly with the auth data. However, when I then try to call Auth.currentSession(), it gives me an error, "No current user". Any idea what I'm missing here?
@epicfaace hey can you check your localStorage because when you call Auth.currentSession(), it will look into the localStorage and get the session object for you.
I'm getting the same exact problem. On my localhost running Auth.signIn and it looks like that it goes trough successfully, because I can console.log output where I can see Session token. I checked localstorage and it looks like it's empty and as @epicfaace mentioned by callingcurrentSession() I get "No current user" too (I bet because localstorage is empty). I tried to use Cache library to check if amplify can write to LocalStorage, and by calling Cache.setItem("test", "test") new record in LocalStorage appeared.
I attached my console:

Here you can see I'm console logging output from Auth.signIn and after resolved promise I called Auth.currentSession which returns rejected promise with "No current user"
@Rhymond, I found the issue, it seems like a known issue in the amplify library. Remove the cookieStorage object from the aws amplify config and it should work then, assuming your user pool is configured properly.
@epicfaace Thanks! My issue was different, just found a fix.
My user was with status FORCE_CHANGE_PASSWORD which doesn't let it login. I created user using Auth.signUp and it worked.
FORCE_CHANGE_PASSWORD was my issue too when trying to auth an admin created user.
See https://github.com/aws-amplify/amplify-js/issues/24 for solution.
Going to close this as the issue seems to have been solved. Please reopen if there are any related questions or concerns.
Most helpful comment
FORCE_CHANGE_PASSWORDwas my issue too when trying to auth an admin created user.See https://github.com/aws-amplify/amplify-js/issues/24 for solution.