1 write to _userManager
Identity.ExternalClaims (1)
Pages\Account\Manage\Disable2fa.cshtml.cs (1)
25
_userManager
= userManager;
9 references to _userManager
Identity.ExternalClaims (9)
Pages\Account\Manage\Disable2fa.cshtml.cs (9)
31
var user = await
_userManager
.GetUserAsync(User);
34
throw new ApplicationException($"Unable to load user with ID '{
_userManager
.GetUserId(User)}'.");
37
if (!await
_userManager
.GetTwoFactorEnabledAsync(user))
39
throw new ApplicationException($"Cannot disable 2FA for user with ID '{
_userManager
.GetUserId(User)}' as it's not currently enabled.");
47
var user = await
_userManager
.GetUserAsync(User);
50
throw new ApplicationException($"Unable to load user with ID '{
_userManager
.GetUserId(User)}'.");
53
var disable2faResult = await
_userManager
.SetTwoFactorEnabledAsync(user, false);
56
throw new ApplicationException($"Unexpected error occurred disabling 2FA for user with ID '{
_userManager
.GetUserId(User)}'.");
59
_logger.LogInformation("User with ID '{UserId}' has disabled 2fa.",
_userManager
.GetUserId(User));