feat: implement user account management features including profile display and password change functionality

This commit is contained in:
Julien Froidefond
2025-10-16 22:27:06 +02:00
parent 3cd58f63e6
commit 83f523c11a
11 changed files with 501 additions and 1 deletions

34
src/app/account/page.tsx Normal file
View File

@@ -0,0 +1,34 @@
import { UserProfileCard } from "@/components/account/UserProfileCard";
import { ChangePasswordForm } from "@/components/account/ChangePasswordForm";
import { UserService } from "@/lib/services/user.service";
import { redirect } from "next/navigation";
export default async function AccountPage() {
try {
const [profile, stats] = await Promise.all([
UserService.getUserProfile(),
UserService.getUserStats(),
]);
return (
<div className="container mx-auto px-4 py-8">
<div className="max-w-4xl mx-auto space-y-8">
<div>
<h1 className="text-3xl font-bold">Mon compte</h1>
<p className="text-muted-foreground mt-2">
Gérez vos informations personnelles et votre sécurité
</p>
</div>
<div className="grid gap-6 md:grid-cols-2">
<UserProfileCard profile={{ ...profile, stats }} />
<ChangePasswordForm />
</div>
</div>
</div>
);
} catch (error) {
console.error("Erreur lors du chargement du compte:", error);
redirect("/login");
}
}