e621 credentials: user fields, API endpoint, Account screen

Backend:
- User model gains e621_username / e621_api_key / e621_base_url
- GET/PUT /api/auth/e621/ for the owner's credentials; /me exposes only
  the username and a configured flag, never the key

Frontend:
- e621 client core: Basic auth, _client param (browsers cannot set a
  User-Agent), serialized queue throttled to 1 request/second, readable
  error mapping
- Account screen (/account): username, API key with reveal toggle,
  base URL (e621 / e926 / custom), Save + Test connection
- Credentials are fetched from the backend and held in memory only,
  cleared on logout
This commit is contained in:
2026-09-17 08:49:00 -05:00
parent a09ab8a160
commit b6409523e6
12 changed files with 555 additions and 6 deletions
+6 -2
View File
@@ -100,14 +100,18 @@ export function AppShell() {
<StatusPill status={status} />
{user ? (
<>
<div className="flex items-center gap-2">
<Link
to="/account"
title="Account settings"
className="flex items-center gap-2 transition hover:opacity-80"
>
<span className="flex h-7 w-7 items-center justify-center rounded-full bg-ctp-surface1 font-mono text-xs font-semibold text-ctp-lavender">
{user.username.slice(0, 1).toUpperCase()}
</span>
<span className="hidden text-sm text-ctp-subtext1 sm:block">
{user.username}
</span>
</div>
</Link>
<button
type="button"
onClick={() => void logout()}
@@ -4,6 +4,7 @@ import {
LogOut,
Menu,
Search,
Settings,
Upload,
type LucideIcon,
} from "lucide-react";
@@ -76,6 +77,12 @@ function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
},
];
if (user) {
list.push({
id: "account",
label: "Account settings",
icon: Settings,
run: () => navigate("/account"),
});
list.push({
id: "logout",
label: `Log out (${user.username})`,