Skip to content

Commit

Permalink
removed comments and console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
seanquiambao committed Oct 1, 2024
1 parent e2d9b9d commit eadddee
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions src/components/ProtectedPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const ProtectedPage = async ({ children, restrictions, title }) => {
throw new Fault(403, "Unauthorized", "You do not have any assigned roles");
}

console.log("session:", session.user.roles);
const authorized = Object.entries(restrictions).some(([key, values]) =>
Array.isArray(values)
? values.includes(session.user.roles[key])
Expand All @@ -51,56 +50,3 @@ const ProtectedPage = async ({ children, restrictions, title }) => {
};

export default ProtectedPage;

// delete later
// useEffect(() => {
// if (RELEASES[pathName] > new Date()) {
// throw new Fault(
// 423,
// "Locked Resource",
// "This resource has not been released",
// );
// }

// if (status === "loading") return;
// if (status !== "authenticated") {
// void signIn("google");
// return;
// }

// if (!session.user.roles && Object.keys(restrictions).length > 0) {
// throw new Fault(
// 403,
// "Unauthorized",
// "You do not have any assigned roles",
// );
// }

// const authorized = Object.entries(restrictions).some(([key, values]) =>
// Array.isArray(values)
// ? values.includes(session.user.roles[key])
// : session.user.roles[key] === values,
// );

// if (!authorized && Object.keys(restrictions).length > 0) {
// throw new Fault(403, "Unauthorized", "You do not have access this page");
// }
// setConfirmed(true);
// }, [status]);

// const navigation = RegExp(/user\/|admin\//).test(pathName);

// return (
// <>
// {status === "loading" && <Loading />}
// {confirmed && (
// <>
// <title>{title}</title>
// {navigation && <Navigation />}
// <div className="z-0 flex h-screen w-full items-start justify-center overflow-x-hidden bg-hackathon-page py-12 lg:py-0">
// <div className="h-full w-11/12">{children}</div>
// </div>
// </>
// )}
// </>
// );

0 comments on commit eadddee

Please sign in to comment.