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:
@@ -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' }] : []),
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user