Skip to content

Commit 35d5c36

Browse files
author
Rajat
committed
Fixed page.tsx of dashboard
1 parent 5fbdc5f commit 35d5c36

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

apps/web/app/(with-contexts)/dashboard/(sidebar)/page.tsx

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/web/app/(with-contexts)/dashboard/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ import { ADMIN_PERMISSIONS } from "@ui-config/constants";
66

77
export default async function Page() {
88
const profile = (await getProfile()) as Profile;
9-
if (checkPermission(profile.permissions, ADMIN_PERMISSIONS)) {
9+
if (!profile) {
10+
redirect("/logout/server");
11+
}
12+
13+
if (checkPermission(profile?.permissions, ADMIN_PERMISSIONS)) {
1014
redirect("/dashboard/overview");
1115
} else {
1216
redirect("/dashboard/my-content");
1317
}
1418

15-
return null;
19+
return <></>;
1620
}

apps/web/next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference types="next/navigation-types/compat/navigation" />
43
/// <reference path="./.next/types/routes.d.ts" />
54

65
// NOTE: This file should not be edited

0 commit comments

Comments
 (0)