Ispravka QR koda za 2FA — generisanje na serveru kao base64 PNG

This commit is contained in:
2026-06-02 22:29:53 +02:00
parent f918b76542
commit 2401f6d5ec
25 changed files with 2449 additions and 48 deletions
+106
View File
@@ -0,0 +1,106 @@
<!DOCTYPE html>
<html lang="sr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dvostepena verifikacija — NTech</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
background: #0f1117;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
}
.kartica {
background: #1a1d2e;
border: 0.5px solid #2a2d3e;
border-radius: 16px;
padding: 40px;
width: 100%;
max-width: 380px;
}
.logo { text-align: center; margin-bottom: 32px; }
.logo-naziv { font-size: 22px; font-weight: 600; color: #fff; }
.opis { font-size: 13px; color: #9ca3af; margin-bottom: 24px; line-height: 1.5; }
h1 { font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.polje { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: #9ca3af; margin-bottom: 6px; }
input {
width: 100%;
padding: 10px 14px;
background: #0f1117;
border: 0.5px solid #2a2d3e;
border-radius: 8px;
font-size: 20px;
color: #fff;
outline: none;
text-align: center;
letter-spacing: 6px;
transition: border-color 0.2s;
}
input:focus { border-color: #4f7ef8; }
.dugme {
width: 100%;
padding: 11px;
background: #4f7ef8;
color: #fff;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
margin-top: 8px;
transition: opacity 0.2s;
}
.dugme:hover { opacity: 0.88; }
.greska {
background: #fef2f2;
border: 0.5px solid #fca5a5;
color: #dc2626;
border-radius: 8px;
padding: 10px 14px;
font-size: 13px;
margin-bottom: 20px;
}
.nazad {
display: block;
text-align: center;
margin-top: 16px;
font-size: 13px;
color: #6b7280;
text-decoration: none;
}
.nazad:hover { color: #9ca3af; }
</style>
</head>
<body>
<div class="kartica">
<div class="logo">
<div class="logo-naziv">NTech</div>
</div>
<h1>Dvostepena verifikacija</h1>
<p class="opis">Unesite 6-cifreni kod iz vaše aplikacije za autentifikaciju.</p>
{{if eq .Greska "1"}}
<div class="greska">Neispravan kod. Pokušajte ponovo.</div>
{{end}}
<form method="POST" action="/prijava/totp">
<div class="polje">
<label for="kod">Kod za verifikaciju</label>
<input type="text" id="kod" name="kod"
inputmode="numeric" pattern="[0-9]{6}"
maxlength="6" autocomplete="one-time-code" autofocus required>
</div>
<button type="submit" class="dugme">Potvrdi</button>
</form>
<a href="/odjava" class="nazad">← Nazad na prijavu</a>
</div>
</body>
</html>