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
Question about Auth.currentUserInfo #358
Comments
Hi @ldgarcia I was able to replicate the behavior you are seeing, this is a bug in the library. I was able to identify a workaround for you while we work on a bugfix: Change your async componentDidMount() {
await (await Auth.currentCredentials()).getPromise(); // Wait for credentials
const info = await Auth.currentUserInfo()
console.log('Returned info: ', info)
this.setState({ info })
} For context, the library tries to read the identityId from the credentials, those might not be ready yet when calling |
Thanks @manueliglesias, I will try using the workaround. |
Issue fixed in #331 |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Do you want to request a feature or report a bug
Not sure if it is a bug, or I am doing something wrong
What is the current behavior?
Auth.currentUserInfo()
returns the user information after the user signs in.checkUser
inAuthenticator
) but nowAuth.currentUserInfo()
returns an empty object.Logged error:
What is the expected behavior?
I think it should return the user information in both cases.
Code for reproducing the issue
The text was updated successfully, but these errors were encountered: