pipekit/pipekit/web/templates/login.html
Paul Trowbridge 31135cf5be web: add session-cookie login for web UI
- New pipekit/web/auth.py: itsdangerous-signed cookie, 8hr expiry,
  auto-generates signing secret in settings table on first use
- GET/POST /login and POST /logout routes (public, no auth dependency)
- All other web routes protected via router-level require_web_auth dep
- Starlette middleware injects request.state.current_user for templates
- Topbar shows logged-in username + logout button when session active
- Reuses existing api_user/api_pass credentials and api_auth_enabled flag
- Add itsdangerous>=2.1 to requirements.txt
- Enable api_auth_enabled in config.yaml

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-06-04 13:21:50 -04:00

29 lines
1.1 KiB
HTML

{% extends "base.html" %}
{% block title %}Login — Pipekit{% endblock %}
{% block content %}
<div style="max-width:22rem;margin:4rem auto">
<div class="panel">
<header>Login</header>
<div class="body">
{% if error %}
<div class="flash err" style="margin-bottom:0.8rem">{{ error }}</div>
{% endif %}
<form method="post" action="/login?next={{ next | urlencode }}">
<label class="field" style="grid-template-columns:1fr">
<span>username</span>
<input type="text" name="username" required autofocus>
</label>
<label class="field" style="grid-template-columns:1fr;margin-top:0.5rem">
<span>password</span>
<input type="password" name="password" required>
</label>
<div class="actions" style="justify-content:flex-end;margin-top:1rem">
<button type="submit" class="primary">Sign in</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}