Feature: Add password change functionality for admin and customers
- Add customer password change page at /account/change-password - Add admin password change page at /admin/change-password - Create AdminUser database table for storing admin credentials - Admin login now checks database first, falls back to env vars - Update admin auth to support bcrypt password hashing - Add change password links to customer account and admin nav - Fix customer login logs back link (was pointing to non-existent /admin) - Add success/error message handling for password changes Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
36cc6dddff
commit
9623ac2fdb
@@ -449,6 +449,15 @@ model OrderItem {
|
||||
designImageDimensions String? // JSON array of {imageId, widthCm, heightCm} for each uploaded image
|
||||
}
|
||||
|
||||
// Admin user account — stores admin credentials (can override env vars if present)
|
||||
model AdminUser {
|
||||
id String @id @default(cuid())
|
||||
username String @unique
|
||||
passwordHash String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// Audit log for admin logins — tracks when the admin panel is accessed
|
||||
model AdminLoginLog {
|
||||
id String @id @default(cuid())
|
||||
|
||||
Reference in New Issue
Block a user