From 3f69e906279fdc843d4428fd3f17b24fb2b927b8 Mon Sep 17 00:00:00 2001 From: anishshobithps Date: Sat, 11 May 2024 19:30:16 +0530 Subject: [PATCH] remove: registration access --- src/app/(content)/register/page.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/(content)/register/page.tsx b/src/app/(content)/register/page.tsx index ae75248..98dd6b9 100644 --- a/src/app/(content)/register/page.tsx +++ b/src/app/(content)/register/page.tsx @@ -14,6 +14,7 @@ import { categoriesList } from "@/data/categoryList"; import { tiaraFont } from "@/lib/fonts"; import { CheckedItem, Event, Events } from "@/lib/interfaces"; import { cn } from "@/lib/utils"; +import { UserRole } from "@prisma/client"; import { signIn, useSession } from "next-auth/react"; import React, { useEffect, useState } from "react"; @@ -213,6 +214,10 @@ const Register: React.FC = () => { return totalSum; }; + if (session.data?.user.role !== UserRole.ADMIN) { + return
Forbidden
; + } + return (