- Rewrite auth.py for multi-user schema (users table with roles) - Auto-migrate from single-user admin_user table to new schema - Add @admin_required decorator for protected routes - Admin routes: /admin/users, /admin/users/new, delete, reset-password - New templates: admin/users.html, user_new.html, user_created.html, password_reset.html - Update login.html for username field, base.html and account.html for admin nav - Max 16 users + 1 admin, session invalidation on delete/password reset 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
63 lines
2.3 KiB
HTML
63 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Password Reset - Stegasoo{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-6 col-lg-5">
|
|
<div class="card border-warning">
|
|
<div class="card-header bg-warning text-dark">
|
|
<i class="bi bi-key fs-4 me-2"></i>
|
|
<span class="fs-5">Password Reset</span>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-warning">
|
|
<i class="bi bi-exclamation-triangle me-2"></i>
|
|
<strong>Important:</strong> This password will only be shown once.
|
|
Make sure to share it with <strong>{{ username }}</strong> securely.
|
|
</div>
|
|
|
|
<p class="text-muted">
|
|
The user's sessions have been invalidated. They will need to log in
|
|
again with the new password.
|
|
</p>
|
|
|
|
<div class="mb-4">
|
|
<label class="form-label text-muted small">New Password for {{ username }}</label>
|
|
<div class="input-group">
|
|
<input type="text" class="form-control form-control-lg font-monospace"
|
|
value="{{ password }}" readonly id="passwordField">
|
|
<button class="btn btn-outline-secondary" type="button"
|
|
onclick="copyField('passwordField')" title="Copy password">
|
|
<i class="bi bi-clipboard"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-grid">
|
|
<a href="{{ url_for('admin_users') }}" class="btn btn-primary">
|
|
<i class="bi bi-arrow-left me-2"></i>Back to Users
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
function copyField(fieldId) {
|
|
const field = document.getElementById(fieldId);
|
|
field.select();
|
|
document.execCommand('copy');
|
|
|
|
// Show brief feedback
|
|
const btn = field.nextElementSibling;
|
|
const originalHTML = btn.innerHTML;
|
|
btn.innerHTML = '<i class="bi bi-check"></i>';
|
|
setTimeout(() => btn.innerHTML = originalHTML, 1000);
|
|
}
|
|
</script>
|
|
{% endblock %}
|