I'm learning AWS Cognito and I'm using the js sdk.
Question: How can I verify if a user is authenticated and valid?
The online documentation explains how to validate a users token:
if (cognitoUser != null) {
cognitoUser.getSession(function(err, session) {
if (err) {
alert(err);
return;
}
console.log('session validity: ' + session.isValid());
The problem here is that the session is valid, even though the user has been deactivated or deleted by an administrator. The above example are only using the local jwt token to validate the session. I want to know if session is valid and user has not been disabled/deleted.
How can that be achieved?