@{ ViewBag.Title = "User Settings"; Layout = "~/Views/Shared/_AdminLayout.cshtml"; var enabled = ViewBag.TwoFactorEnabled == true; }

User Settings

Account: @ViewBag.Username

Change password

@if (TempData["pwdOk"] != null) {
@TempData["pwdOk"]
} @if (TempData["pwdError"] != null) {
@TempData["pwdError"]
} @using (Html.BeginForm("ChangePassword", "admin", FormMethod.Post)) { @Html.AntiForgeryToken()
At least 8 characters.
}

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 {
  1. Open your authenticator app and scan the QR code below.
  2. Or enter this secret manually: @ViewBag.SetupSecret
  3. Enter the 6-digit code to confirm and enable 2FA.
using (Html.BeginForm("EnableTwoFactor", "admin", FormMethod.Post)) { @Html.AntiForgeryToken()
} }