Skip to content

Commit 3c3b438

Browse files
committed
feat(dashboard): simplify admin dashboard by removing user authentication check (middleware handles it)
1 parent c2ebadf commit 3c3b438

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

app/dashboard/page.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
import { createClient } from "@/utils/supabase/server";
2-
import { redirect } from "next/navigation";
3-
41
export default async function DashboardPage() {
5-
const supabase = await createClient();
6-
const {
7-
data: { user },
8-
} = await supabase.auth.getUser();
9-
10-
if (!user || user.app_metadata?.role !== "admin") {
11-
redirect("/");
12-
}
13-
142
return (
153
<main className="flex min-h-screen flex-col p-8">
164
<h1 className="text-3xl font-bold">Admin Dashboard</h1>
175
<p className="mt-2 text-muted-foreground">
18-
Signed in as <span className="font-medium">{user.email}</span>
6+
You are admin
197
</p>
208
</main>
219
);

0 commit comments

Comments
 (0)