public virtual async Task GetTwoFactorEnabledAsync()

in src/Amazon.AspNetCore.Identity.Cognito/CognitoUserStore/CognitoUserStore.IUserTwoFactorStore.cs [39:63]


        public virtual async Task<bool> GetTwoFactorEnabledAsync(TUser user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user));
            }

            var request = new AdminGetUserRequest
            {
                Username = user.Username,
                UserPoolId = _pool.PoolID
            };

            try
            {
                var userSettings = await _cognitoClient.AdminGetUserAsync(request, cancellationToken).ConfigureAwait(false);

                return userSettings.MFAOptions?.Count > 0;
            }
            catch (AmazonCognitoIdentityProviderException e)
            {
                throw new CognitoServiceException("Failed to retrieve 2FA settings for the Cognito User", e);
            }
        }