[Vuejs]-AWS Cognito Authentication Not Working as Expected

0👍

In dashboard.vue you are creating a new user instance, that user, is not authenticated. Try getUserAttributes just after autheticateUser.

The reason is, when you call authenticateUser, after success, some properties are settled to the calling user instance, token, signature, etc…

Then when you call another method, just like getUserAttributes, it uses that info.

Your code in dashboard.vue fails because at the moment you call the method, the user instance is not authenticated, as you are able to read from the error message.

You need authenticate ALL user INSTANCEs.

Leave a comment