05/02/2026 updated code for security 3
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Sign In — PassKeeper{% endblock %}
|
||||
{% block body_class %}auth-page{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% extends "base.html" %} {% block title %}Sign In — PassKeeper{% endblock %} {%
|
||||
block body_class %}auth-page{% endblock %} {% block body %}
|
||||
<div class="auth-container">
|
||||
<div class="auth-card">
|
||||
<div class="auth-logo">
|
||||
@@ -20,24 +17,46 @@
|
||||
<form id="login-form" novalidate>
|
||||
<div class="form-group">
|
||||
<label for="email">Email address</label>
|
||||
<input type="email" id="email" name="email" required
|
||||
autocomplete="email" placeholder="you@example.com">
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
name="email"
|
||||
required
|
||||
autocomplete="email"
|
||||
placeholder="you@example.com"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Master password</label>
|
||||
<div class="input-with-toggle">
|
||||
<input type="password" id="password" name="password" required
|
||||
autocomplete="current-password" placeholder="Enter master password">
|
||||
<button type="button" class="btn-show-pass" id="toggle-login-pass"
|
||||
aria-label="Toggle password visibility">👁</button>
|
||||
<input
|
||||
type="password"
|
||||
id="password"
|
||||
name="password"
|
||||
required
|
||||
autocomplete="current-password"
|
||||
placeholder="Enter master password"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-show-pass"
|
||||
id="toggle-login-pass"
|
||||
aria-label="Toggle password visibility"
|
||||
>
|
||||
👁
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary btn-full" data-loading-text="Verifying…">
|
||||
<button
|
||||
type="submit"
|
||||
class="btn-primary btn-full"
|
||||
data-loading-text="Verifying…"
|
||||
>
|
||||
Sign in
|
||||
</button>
|
||||
</form>
|
||||
<p class="auth-footer">
|
||||
Don't have an account? <a href="/register">Create one</a><br>
|
||||
Don't have an account? <a href="/register">Create one</a><br />
|
||||
Forgot your password? <a href="/recover">Use recovery code</a>
|
||||
</p>
|
||||
</div>
|
||||
@@ -45,29 +64,65 @@
|
||||
<!-- Step 2: TOTP verification (hidden until MFA required) -->
|
||||
<div id="login-step-2" class="hidden">
|
||||
<h1 class="auth-title">Two-factor authentication</h1>
|
||||
<p class="auth-step-hint">Enter the 6-digit code from your authenticator app.</p>
|
||||
<p class="auth-step-hint">
|
||||
Enter the 6-digit code from your authenticator app.
|
||||
</p>
|
||||
<form id="mfa-form" novalidate>
|
||||
<p id="mfa-error" class="form-error hidden">Invalid or expired code. Try again.</p>
|
||||
<div class="form-group">
|
||||
<p id="mfa-error" class="form-error hidden">
|
||||
Invalid or expired code. Try again.
|
||||
</p>
|
||||
|
||||
<!-- TOTP input (default) -->
|
||||
<div id="mfa-totp-section" class="form-group">
|
||||
<label for="mfa-code">Authenticator code</label>
|
||||
<input type="text" id="mfa-code" name="mfa_code"
|
||||
inputmode="numeric" pattern="[0-9]{6}" maxlength="6"
|
||||
autocomplete="one-time-code" placeholder="000000">
|
||||
<input
|
||||
type="text"
|
||||
id="mfa-code"
|
||||
name="mfa_code"
|
||||
inputmode="numeric"
|
||||
pattern="[0-9]{6}"
|
||||
maxlength="6"
|
||||
autocomplete="one-time-code"
|
||||
placeholder="000000"
|
||||
/>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary btn-full" data-loading-text="Verifying…">
|
||||
|
||||
<!-- Backup code input (hidden until user switches) -->
|
||||
<div id="mfa-backup-section" class="form-group hidden">
|
||||
<label for="mfa-backup-code">Backup code</label>
|
||||
<input
|
||||
type="text"
|
||||
id="mfa-backup-code"
|
||||
name="mfa_backup_code"
|
||||
autocomplete="off"
|
||||
placeholder="e.g. ab3rqxyz9p"
|
||||
style="letter-spacing: 0.05em"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn-primary btn-full"
|
||||
data-loading-text="Verifying…"
|
||||
>
|
||||
Verify
|
||||
</button>
|
||||
</form>
|
||||
<div class="auth-footer">
|
||||
<button class="btn-text" id="btn-back-to-password">← Back to sign in</button>
|
||||
<button class="btn-text" id="btn-use-backup-code">
|
||||
Use a backup code instead
|
||||
</button>
|
||||
<button class="btn-text hidden" id="btn-use-totp-code">
|
||||
Use authenticator code instead
|
||||
</button>
|
||||
<button class="btn-text" id="btn-back-to-password">
|
||||
← Back to sign in
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
{% endblock %} {% block scripts %}
|
||||
<script src="{{ url_for('static', filename='js/crypto.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/auth.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -899,6 +899,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Audit Log Section -->
|
||||
<div class="settings-section">
|
||||
<h4 class="settings-section-title">📋 Login & Activity History</h4>
|
||||
<p class="settings-desc">Recent account activity. Unfamiliar entries may indicate unauthorised access.</p>
|
||||
<div id="audit-log-list" style="margin-top:8px;font-size:13px;"></div>
|
||||
<button class="btn-secondary" id="btn-load-more-audit" style="margin-top:10px;display:none;">Load more</button>
|
||||
</div>
|
||||
|
||||
<div class="settings-section settings-section-danger">
|
||||
<h4 class="settings-section-title">⚠️ Danger Zone</h4>
|
||||
<p class="settings-desc">
|
||||
@@ -1051,4 +1061,4 @@
|
||||
<script src="{{ url_for('static', filename='js/auth.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/sharing.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='js/vault.js') }}"></script>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user