feat: implement initial admin setup (Story 1.1)
Add complete initial admin setup functionality including: - SetupForm with email, password, and password confirmation fields - Password validation (minimum 12 characters) and confirmation matching - Email format validation - Setup route with GET (display form) and POST (process setup) handlers - bcrypt password hashing before storing admin credentials - Auto-login after successful setup with session management - First-run detection middleware that redirects to /setup if no admin exists - Setup page returns 404 after admin account is created - Base HTML template with Pico CSS integration - Admin dashboard placeholder template - 404 error template All tests pass with 90.09% code coverage (exceeds 80% requirement). Code passes ruff linting and mypy type checking. Story: 1.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
15
src/routes/admin.py
Normal file
15
src/routes/admin.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Admin routes for Sneaky Klaus application."""
|
||||
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
admin_bp = Blueprint("admin", __name__, url_prefix="/admin")
|
||||
|
||||
|
||||
@admin_bp.route("/dashboard")
|
||||
def dashboard():
|
||||
"""Display admin dashboard.
|
||||
|
||||
Returns:
|
||||
Rendered admin dashboard template.
|
||||
"""
|
||||
return render_template("admin/dashboard.html")
|
||||
Reference in New Issue
Block a user