- 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>
62 lines
2.2 KiB
HTML
62 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Login - Stegasoo{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-5 col-lg-4">
|
|
<div class="card">
|
|
<div class="card-header text-center">
|
|
<i class="bi bi-shield-lock fs-1 d-block mb-2"></i>
|
|
<h5 class="mb-0">Login</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST" action="{{ url_for('login') }}">
|
|
<div class="mb-3">
|
|
<label class="form-label">
|
|
<i class="bi bi-person me-1"></i> Username
|
|
</label>
|
|
<input type="text" name="username" class="form-control"
|
|
placeholder="Enter your username" required autofocus>
|
|
</div>
|
|
|
|
<div class="mb-4">
|
|
<label class="form-label">
|
|
<i class="bi bi-key me-1"></i> Password
|
|
</label>
|
|
<div class="input-group">
|
|
<input type="password" name="password" class="form-control"
|
|
id="passwordInput" required>
|
|
<button class="btn btn-outline-secondary" type="button"
|
|
onclick="togglePassword('passwordInput', this)">
|
|
<i class="bi bi-eye"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="bi bi-box-arrow-in-right me-2"></i>Login
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
function togglePassword(inputId, btn) {
|
|
const input = document.getElementById(inputId);
|
|
const icon = btn.querySelector('i');
|
|
if (input.type === 'password') {
|
|
input.type = 'text';
|
|
icon.classList.replace('bi-eye', 'bi-eye-slash');
|
|
} else {
|
|
input.type = 'password';
|
|
icon.classList.replace('bi-eye-slash', 'bi-eye');
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|