feat: user profile self-service + admin password reset

- Add PUT /api/auth/profile for users to change their own email/password
- Add POST /api/admin/users/:id/reset-password for admin password resets
- Add updateProfileSchema and resetPasswordSchema validation (Zod)
- Create Profile.jsx page with email change and password change forms
- Add Reset Password button with inline form to ManageUsers in Admin panel
- Add /profile route and Account nav link in Layout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-04 21:00:58 +00:00
co-authored by Claude Opus 4.6
parent efafbea297
commit 2f381ff5f9
7 changed files with 313 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
import { Outlet, NavLink, useLocation } from 'react-router-dom';
import { useAuth } from '../contexts/AuthContext';
import ThemeToggle from './ThemeToggle';
import { Calendar, Clock, Shield, LogOut, Menu, X } from 'lucide-react';
import { Calendar, Clock, Shield, LogOut, Menu, X, User } from 'lucide-react';
import { useState } from 'react';
export default function Layout() {
@@ -12,6 +12,7 @@ export default function Layout() {
const navItems = [
{ to: '/', icon: Clock, label: 'Timesheet' },
{ to: '/history', icon: Calendar, label: 'History' },
{ to: '/profile', icon: User, label: 'Account' },
...(isAdmin ? [{ to: '/admin', icon: Shield, label: 'Admin' }] : []),
];