feat : update
This commit is contained in:
@@ -20,11 +20,11 @@ export default async function ProfilePage({ searchParams }: PageProps<"/profile"
|
||||
const nextPath = safeAuthReturnPath(next);
|
||||
const setupNextPath = nextPath === "/profile" || nextPath.startsWith("/profile?") ? "/" : nextPath;
|
||||
const session = await getCustomerSession();
|
||||
if (!session) redirect("/login?next=%2Fprofile");
|
||||
if (!session) redirect("/auth/login?next=%2Fprofile");
|
||||
const [user] = await getDb().select({ name: users.name, email: users.email,
|
||||
emailVerified: users.emailVerified, image: users.image })
|
||||
.from(users).where(eq(users.id, session.user.id)).limit(1);
|
||||
if (!user) redirect("/login?next=%2Fprofile");
|
||||
if (!user) redirect("/auth/login?next=%2Fprofile");
|
||||
return <div className="min-h-svh">{isAuthorizedAdmin(session.user) ? <AdminHeader /> : <SiteHeader />}
|
||||
<main className="mx-auto max-w-5xl p-4 py-10 sm:p-8">
|
||||
<h1 className="mb-6 font-heading text-3xl font-semibold">โปรไฟล์ของฉัน</h1>
|
||||
|
||||
Reference in New Issue
Block a user