amplify-js: Amplify currentUserinfo returns null
Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker
Describe the bug
When I used authenticationFlowType: 'USER_PASSWORD_AUTH' in my configuration of amplify. After I signin with my usrname and password then Auth.currentUserInfo() is returning null.
I doubled checked it. If I remove authenticationFlowtype it shows all the user properties
To Reproduce Steps to reproduce the behavior:
- Go to ‘config file and add authenticationFlowType: ‘USER_PASSWORD_AUTH’’
- check on ‘.Auth.currentUserInfo()’
- See Null
Expected behavior It should return user attributes
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 50 (8 by maintainers)
@jmandivarapu1 as a temporary patch, can you see if you can use this to replace currentUserInfo?
(that’s the syntax off the top of my head, you may need log currentSession() to see how to get the idToken payload if that doesn’t work)
Any update?
i am glad you used. It all started with the crazy amplify analytics.
https://github.com/aws-amplify/amplify-cli/issues/2593
@jmandivarapu1 for getting user attributes I used this:
Yeah I like the idea. But don’t know what’s happening why session is null and all.
But it’s throwing error No current user.
But when I did var cognito_resp= await Auth.signIn(this.state.email, this.state.password);