We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2ebadf commit 3c3b438Copy full SHA for 3c3b438
1 file changed
app/dashboard/page.tsx
@@ -1,21 +1,9 @@
1
-import { createClient } from "@/utils/supabase/server";
2
-import { redirect } from "next/navigation";
3
-
4
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
14
return (
15
<main className="flex min-h-screen flex-col p-8">
16
<h1 className="text-3xl font-bold">Admin Dashboard</h1>
17
<p className="mt-2 text-muted-foreground">
18
- Signed in as <span className="font-medium">{user.email}</span>
+ You are admin
19
</p>
20
</main>
21
);
0 commit comments