cognito-local
cognito-local copied to clipboard
Attempting to getUser for a migrated user results in UserNotFound exception
This is because the sub
attribute is not populated in the access token for migrated users, so this lookup fails:
const user = await userPool.getUserByUsername(ctx, decodedToken.sub);
if (!user) {
throw new import_errors.UserNotFoundError();
}