public async Task<ActionResult> DisableTwoFactorAuthentication()
{
await UserManager.SetTwoFactorEnabledAsync(User.Identity.GetUserId(), false);
var users = await UserManager.FindByIdAsync(User.Identity.GetUserId());
if (users != null)
{
await SignInManager.SignInAsync(users, isPersistent: false, rememberBrowser: false);
}
return RedirectToAction("Index", "Manage");
}
public void ManageController_DisableTwoFactorAuthentication_Test0() { // Initialization ManageController ctl = new ManageController(); // To test if it is null var result = ctl.DisableTwoFactorAuthentication(); Assert.IsNotNull(result); }