Address findings from the templates code review: - Fix XSS in admin.html onclick handlers via data attributes - Fix XSS in 5 edit page signal initializations via JSON serialization - Fix register.html token exposure by moving to data attribute - Add entity_icon, quick_notes_toggles, add_form_submit macros - Replace hardcoded colors with design tokens (warning, error, success) - Add warning design tokens to CSS theme - Scope MutationObserver to main element - Add defer to webauthn.js script tags - Refactor login/register JS to arrow functions - Guard lightbox script behind image_url check - Fix else-if to elif in 5 templates
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
{% extends "base.html" %} {% import "partials/icons.html" as icons %}
|
|
{% block title %}Brewlog · CLI Authentication{% endblock %}
|
|
{% block content %}
|
|
<div class="mx-auto max-w-md">
|
|
<div class="rounded-lg border bg-surface p-6">
|
|
{% if token.is_some() %}
|
|
<div class="flex flex-col items-center text-center gap-3">
|
|
{{ icons::check_circle("h-10 w-10 text-success") }}
|
|
<h1 class="text-2xl font-semibold text-accent">CLI Authenticated</h1>
|
|
<p class="text-sm text-text-secondary">
|
|
Your CLI has been authenticated successfully. You can close this
|
|
window and return to the terminal.
|
|
</p>
|
|
</div>
|
|
{% elif error.is_some() %}
|
|
<div class="flex flex-col items-center text-center gap-3">
|
|
{{ icons::x_circle("h-10 w-10 text-error") }}
|
|
<h1 class="text-2xl font-semibold text-accent">
|
|
Authentication Failed
|
|
</h1>
|
|
<div
|
|
class="w-full rounded-md bg-error-bg border border-error-border p-3 text-sm text-error-text"
|
|
>
|
|
{{ error.as_ref().unwrap() }}
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="flex flex-col items-center text-center gap-3">
|
|
{{ icons::spinner("h-10 w-10") }}
|
|
<h1 class="text-2xl font-semibold text-accent">CLI Authentication</h1>
|
|
<p class="text-sm text-text-secondary">
|
|
Processing authentication…
|
|
</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|