Files
lms-sb/src/app/(student)/profile/page.tsx
T
admins c445bfacad Add student profile page with password change
- New page /profile: shows name/email and password change form
- Uses authClient.changePassword (current + new + confirm)
- Student name in header is now a link to /profile

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 17:03:33 +05:00

43 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { headers } from "next/headers";
import { auth } from "@/lib/auth";
import { redirect } from "next/navigation";
import { ChangePasswordForm } from "./change-password-form";
export const metadata = { title: "Профиль" };
export default async function ProfilePage() {
const session = await auth.api.getSession({ headers: await headers() });
if (!session) redirect("/login");
return (
<main className="max-w-lg mx-auto px-4 py-10 w-full">
<h1 className="text-xl font-bold tracking-wide mb-8" style={{ color: "var(--foreground)" }}>
Профиль
</h1>
<div className="card-aubade p-6 mb-6">
<h2 className="text-xs uppercase tracking-widest font-bold mb-4" style={{ color: "var(--muted-foreground)" }}>
Аккаунт
</h2>
<div className="space-y-3 text-sm" style={{ color: "var(--foreground)" }}>
<div className="flex justify-between">
<span style={{ color: "var(--muted-foreground)" }}>Имя</span>
<span>{session.user.name}</span>
</div>
<div className="flex justify-between">
<span style={{ color: "var(--muted-foreground)" }}>Email</span>
<span>{session.user.email}</span>
</div>
</div>
</div>
<div className="card-aubade p-6">
<h2 className="text-xs uppercase tracking-widest font-bold mb-4" style={{ color: "var(--muted-foreground)" }}>
Смена пароля
</h2>
<ChangePasswordForm />
</div>
</main>
);
}