How to exit amazon cognito javascript and clear cached id

So far, I managed to log into the system cognitively and synchronize the data, but I was stuck at the conclusion of users. I can exit the identity providers, but after logging in to cognito, I get an error message for invalid logins. When I restart the application, although it works.

+8
amazon-web-services amazon-cognito
source share
2 answers

An issue was created for this. The current workaround is to clear the cached identifier in the Cognito Credentials object and then reinitialize it:

cognitoCredentials.clearCachedId(); cognitoCredentials = new AWS.CognitoIdentityCredentials(cognitoParams); AWS.config.credentials = cognitoCredentials; 

Where cognitoParams is an object used to initialize credentials, for example:

 cognitoParams = { IdentityPoolId: 'us-east-1:ebee2fff-acde-4382-a090-5990604a007d' }; 
+7
source share

After exiting the identity providers, try calling clearCachedId () on the CognitoIdentityCredentials provider. It should look something like this:

AWS.config.credentials.clearCachedId();

+1
source share

All Articles