public virtual async Task FindByEmailAsync()

in src/Amazon.AspNetCore.Identity.Cognito/CognitoUserStore/CognitoUserStore.IUserEmailStore.cs [38:65]


        public virtual async Task<TUser> FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            try
            {
                var result = await _cognitoClient.ListUsersAsync(new ListUsersRequest
                {
                    Filter = "email = \"" + normalizedEmail + "\"",
                    UserPoolId = _pool.PoolID
                }, cancellationToken).ConfigureAwait(false);

                if (result.Users != null && result.Users.Count > 0)
                {
                    return _pool.GetUser(result.Users[0].Username,
                        result.Users[0].UserStatus,
                        result.Users[0].Attributes?
                            .ToDictionary(att => att.Name, att => att.Value) ??
                                new Dictionary<string, string>()) as TUser;
                }
            }
            catch (AmazonCognitoIdentityProviderException e)
            {
                throw new CognitoServiceException("Failed to find the Cognito User by email", e);
            }

            return null;
        }