Replace username/password authentication with FIDO2/WebAuthn passkey-based auth using webauthn-rs. Sessions and bearer tokens are unchanged — only the way they are created changes. - Add webauthn-rs, uuid, open, url deps; remove argon2, rpassword - Add passkey_credentials and registration_tokens tables (migrations 17-18) - Add domain entities, typed IDs, and repository traits for passkeys/tokens - Add SQL repository implementations for passkeys and registration tokens - Add ChallengeStore for in-memory WebAuthn ceremony state - Add WebAuthn route handlers (register/auth start+finish ceremonies) - Add CLI browser handoff for token creation (opens browser, local callback) - Replace login form with "Sign in with Passkey" button - Add registration page for first-user bootstrap via one-time token - Replace BREWLOG_ADMIN_USERNAME/PASSWORD with BREWLOG_RP_ID/RP_ORIGIN - Change default BREWLOG_URL from 127.0.0.1 to localhost (WebAuthn requires it)
24 lines
920 B
HTML
24 lines
920 B
HTML
{% extends "base.html" %}
|
|
{% block title %}Brewlog · CLI Authentication{% endblock %}
|
|
{% block content %}
|
|
<div class="mx-auto max-w-md">
|
|
<div class="rounded-lg border border-amber-300 bg-amber-100/80 p-6 shadow-sm">
|
|
{% if token.is_some() %}
|
|
<h1 class="text-2xl font-semibold text-green-700">Authenticated</h1>
|
|
<p class="mt-2 text-sm text-stone-600">
|
|
Your CLI has been authenticated. You can close this window.
|
|
</p>
|
|
{% else if error.is_some() %}
|
|
<h1 class="text-2xl font-semibold text-red-700">Authentication Failed</h1>
|
|
<div class="mt-4 rounded-md bg-red-100 border border-red-300 p-3 text-sm text-red-800">
|
|
{{ error.as_ref().unwrap() }}
|
|
</div>
|
|
{% else %}
|
|
<h1 class="text-2xl font-semibold text-amber-700">CLI Authentication</h1>
|
|
<p class="mt-2 text-sm text-stone-600">
|
|
Processing authentication...
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|