user authentication
This commit is contained in:
35
web/templates/mfa.html
Normal file
35
web/templates/mfa.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{{define "mfa"}}
|
||||
{{template "base" .}}
|
||||
{{end}}
|
||||
|
||||
{{define "mfa_content"}}
|
||||
<div class="max-w-md mx-auto p-6">
|
||||
<h1 class="text-2xl font-bold text-white mb-2">Multi‑Factor Authentication</h1>
|
||||
<p class="text-gray-400 mb-6">Enter the 6‑digit code from your authenticator app.</p>
|
||||
|
||||
{{if .error}}
|
||||
<div class="mb-4 p-3 rounded bg-red-700 text-white">{{.error}}</div>
|
||||
{{end}}
|
||||
|
||||
<form id="mfa-form" class="space-y-4" method="POST" action="/editor/mfa">
|
||||
<input type="hidden" name="csrf_token" value="{{.csrf_token}}" />
|
||||
<div>
|
||||
<label for="code" class="block text-sm font-medium text-gray-300 mb-2">Authentication code</label>
|
||||
<input id="code" name="code" inputmode="numeric" pattern="[0-9]{6}" maxlength="6" class="form-input" placeholder="123456" required />
|
||||
</div>
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="btn-primary"><i class="fas fa-right-to-bracket mr-2"></i>Verify</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{define "mfa_scripts"}}
|
||||
<script>
|
||||
// Optional: autofocus the code field
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const code = document.getElementById('code');
|
||||
if (code) code.focus();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user