Skip to content

Commit

Permalink
remove: registration access
Browse files Browse the repository at this point in the history
  • Loading branch information
anishshobithps committed May 11, 2024
1 parent 2b3bf85 commit 3f69e90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/(content)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -213,6 +214,10 @@ const Register: React.FC = () => {
return totalSum;
};

if (session.data?.user.role !== UserRole.ADMIN) {
return <div>Forbidden</div>;
}

return (
<div className="w-full gap-4 p-2 pt-36 md:px-20 lg:px-28 xl:px-40 mx-auto duration-500">
<Card className="w-full">
Expand Down

0 comments on commit 3f69e90

Please sign in to comment.