0
Hello I am using the sdk of aws, to recover the information of the logged in user I am calling the method:
Auth.currentUserInfo();
But he returns the object:
attributes: {
sub: "13fd444d-2b2c-4d5c-b8b5-022fd599fd11", email_verified: true,
phone_number_verified: false, phone_number: "+5599999999999",
preferred_username: "email"
},
id: undefined,
username: "456e972da800ba06e8a22bc8a9910d4e"
Notice that it returns id: undefined
Why does that happen? I’m working with the version: "aws-amplify": "^1.1.18"
link to documentation here
error that appears when enabling AWS debug
Cool! that gives me a bigger north, but when implementing in my code, it generated this error: Uncaught (in Promise) Typeerror: _a. sent(...). getPromise is not a Function
– Julio Henrique
you tried the:
async componentDidMount() {
 const user = await Auth.currentAuthenticatedUser()
 console.log('user info:', user.signInUserSession.idToken.payload)
 console.log('username:', user.username)
}
– usuario
tested, it works and returns me information, but when I use await Auth.currentUserInfo(); it returns the objt with everything filled except the id as Undefined. PS: on my friend’s MAC works the same code and returns an id, on the windowns I tested back Undefined
– Julio Henrique