From 096c9bc2973394eeff4d843bf97aa734b50e0100 Mon Sep 17 00:00:00 2001 From: Jonathan Hvid Date: Wed, 17 Jun 2026 15:42:45 +0200 Subject: [PATCH] feat(auth): self-service password change + admin password reset - /account gains a Change password form (verify current, 8+ char new, confirm match) backed by updateUserPassword + verifyPassword/hashPassword. - Admin users resource gains a "Reset password" action that generates a fresh temp password, sets it immediately, and reveals it once in the panel (new temp-password action-result, reusing the copy-box UI) for the admin to send to the user. - Backstage top-left logo now links to the portal (main menu). Temp passwords are generated + hashed at request time; never stored in git or logged. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/admin/components/AdminLayout.astro | 2 +- src/admin/components/ResourceEditPanel.astro | 12 +++ src/admin/resource-types.ts | 7 +- src/admin/resources/users.ts | 16 ++++ src/lib/auth.ts | 6 ++ src/lib/db.ts | 5 + src/pages/account.astro | 99 +++++++++++++++++--- src/pages/admin/[resource].astro | 3 + 8 files changed, 137 insertions(+), 13 deletions(-) diff --git a/src/admin/components/AdminLayout.astro b/src/admin/components/AdminLayout.astro index 9b7aefb..448b0d6 100644 --- a/src/admin/components/AdminLayout.astro +++ b/src/admin/components/AdminLayout.astro @@ -59,7 +59,7 @@ const hasAnyResources = groupedEntries.some((g) => g.entries.length > 0);