Two-factor authentication
@if (enabled)
{
Enabled
}
else
{
Disabled
}
@if (TempData["tfaOk"] != null)
{
@TempData["tfaOk"]
}
@if (TempData["tfaError"] != null)
{
@TempData["tfaError"]
}
@if (enabled)
{
2FA is active. Enter a current authenticator code to disable it.
using (Html.BeginForm("DisableTwoFactor", "admin", FormMethod.Post))
{
@Html.AntiForgeryToken()
}
}
else
{
- Open your authenticator app and scan the QR code below.
- Or enter this secret manually:
@ViewBag.SetupSecret
- Enter the 6-digit code to confirm and enable 2FA.
using (Html.BeginForm("EnableTwoFactor", "admin", FormMethod.Post))
{
@Html.AntiForgeryToken()
}
}