ApplicationParts.Controllers.ManageController.DisableTwoFactorAuthentication C# (CSharp) Method

DisableTwoFactorAuthentication() private method

private DisableTwoFactorAuthentication ( ) : Task
return Task
        public async Task<IActionResult> DisableTwoFactorAuthentication()
        {
            var user = await GetCurrentUserAsync();
            if (user != null)
            {
                await _userManager.SetTwoFactorEnabledAsync(user, false);
                await _signInManager.SignInAsync(user, isPersistent: false);
                _logger.LogInformation(2, "User disabled two-factor authentication.");
            }
            return RedirectToAction(nameof(Index), "Manage");
        }