view/mfa.html
Rama main · réplica de lectura del repositorio original.
{{define "title"}}{{.ThemeTitle}} - Verification{{end}}
{{define "content"}}
<form class="auth-card" method="POST" action="{{authURL "/mfa"}}">
{{template "logo" .}}
<h1 class="auth-title">Verification</h1>
{{if eq .Method "email"}}
<p class="auth-text">Enter the code from your email</p>
{{else}}
<p class="auth-text">Your account requires additional verification. Enter the 6-digit code from your authenticator app.</p>
{{end}}
{{ .csrfField }}
<input type="hidden" name="challenge_id" value="{{.ChallengeID}}" />
{{if .Message}}
<div class="auth-info" role="status">{{.Message}}</div>
{{end}}
{{if .Error}}
<div class="auth-error" role="alert">{{.Error}}</div>
{{end}}
<div class="auth-field">
<label class="auth-label" for="code">{{if eq .Method "email"}}Code{{else}}Enter code from app{{end}}</label>
<input class="auth-input" type="text" id="code" name="code" required maxlength="6" pattern="[0-9]{6}" autocomplete="one-time-code" inputmode="numeric" placeholder="000000" style="text-align:center;letter-spacing:6px;font-size:1.25rem;" />
</div>
{{if .TrustDeviceEnabled}}
<div class="auth-checkbox">
<input type="checkbox" id="trust_device" name="trust_device" />
<label for="trust_device">Trust this device for {{.TrustDeviceDays}} days</label>
</div>
{{end}}
<button class="auth-btn" type="submit">Verify</button>
{{if eq .Method "email"}}
<a class="auth-btn-secondary" href="{{authURL "/mfa"}}?challenge_id={{.ChallengeID}}" style="margin-top:0.75rem;">Resend code</a>
{{end}}
{{if .CanSwitch}}
{{if eq .Method "email"}}
{{if .UserTotpVerified}}
<a class="auth-btn-text" href="{{authURL "/mfa"}}?challenge_id={{.ChallengeID}}&switch_to=totp">Verify using authenticator app</a>
{{end}}
{{else}}
<a class="auth-btn-text" href="{{authURL "/mfa"}}?challenge_id={{.ChallengeID}}&switch_to=email">Verify using email</a>
{{end}}
{{end}}
</form>
{{end}}