diff --git a/server/emails/sendEmail.ts b/server/emails/sendEmail.ts index f8719e0f..2a3852f2 100644 --- a/server/emails/sendEmail.ts +++ b/server/emails/sendEmail.ts @@ -1,4 +1,4 @@ -import { render } from "@react-email/components"; +import { render } from "@react-email/render"; import { ReactElement } from "react"; import emailClient from "@server/emails"; import logger from "@server/logger"; @@ -21,7 +21,9 @@ export async function sendEmail( return; } + logger.debug("Rendering email templatee...") const emailHtml = await render(template); + logger.debug("Done rendering email templatee") const options = { from: opts.from, diff --git a/src/app/[orgId]/settings/access/roles/components/RolesDataTable.tsx b/src/app/[orgId]/settings/access/roles/components/RolesDataTable.tsx index 3d42edc6..315d0bcc 100644 --- a/src/app/[orgId]/settings/access/roles/components/RolesDataTable.tsx +++ b/src/app/[orgId]/settings/access/roles/components/RolesDataTable.tsx @@ -76,7 +76,7 @@ export function RolesDataTable({ } className="w-full pl-8" /> - + )} @@ -161,18 +164,17 @@ export default function UsersTable({ users: u }: UsersTableProps) { )} - + + )} diff --git a/src/app/[orgId]/settings/components/Header.tsx b/src/app/[orgId]/settings/components/Header.tsx index f4e6045e..35a7f22a 100644 --- a/src/app/[orgId]/settings/components/Header.tsx +++ b/src/app/[orgId]/settings/components/Header.tsx @@ -149,7 +149,7 @@ export default function Header({ email, orgId, name, orgs }: HeaderProps) { size="lg" role="combobox" aria-expanded={open} - className="w-full md:w-[200px] h-12 px-3 py-4 bg-neutral hover:bg-muted" + className="w-full md:w-[200px] h-12 px-3 py-4 bg-neutral hover:bg-neutral" >
@@ -202,29 +202,6 @@ export default function Header({ email, orgId, name, orgs }: HeaderProps) { - - {/* */}
diff --git a/src/app/[orgId]/settings/resources/components/ResourcesDataTable.tsx b/src/app/[orgId]/settings/resources/components/ResourcesDataTable.tsx index 6d04c9ad..2ffad8c1 100644 --- a/src/app/[orgId]/settings/resources/components/ResourcesDataTable.tsx +++ b/src/app/[orgId]/settings/resources/components/ResourcesDataTable.tsx @@ -77,7 +77,7 @@ export function ResourcesDataTable({ } className="w-full pl-8" /> - + + + ); diff --git a/src/app/[orgId]/settings/sites/components/SitesDataTable.tsx b/src/app/[orgId]/settings/sites/components/SitesDataTable.tsx index e4e8af59..c538e3b9 100644 --- a/src/app/[orgId]/settings/sites/components/SitesDataTable.tsx +++ b/src/app/[orgId]/settings/sites/components/SitesDataTable.tsx @@ -77,7 +77,7 @@ export function SitesDataTable({ } className="w-full pl-8" /> - + + + ); }, diff --git a/src/app/setup/layout.tsx b/src/app/setup/layout.tsx index 00fb0917..e0e4954f 100644 --- a/src/app/setup/layout.tsx +++ b/src/app/setup/layout.tsx @@ -1,4 +1,7 @@ +import { verifySession } from "@app/lib/auth/verifySession"; import { Metadata } from "next"; +import { redirect } from "next/navigation"; +import { cache } from "react"; export const metadata: Metadata = { title: `Setup - Pangolin`, @@ -10,5 +13,12 @@ export default async function SetupLayout({ }: { children: React.ReactNode; }) { + const getUser = cache(verifySession); + const user = await getUser(); + + if (!user) { + redirect("/"); + } + return
{children}
; } diff --git a/src/app/setup/page.tsx b/src/app/setup/page.tsx index fe423f9a..95b71e01 100644 --- a/src/app/setup/page.tsx +++ b/src/app/setup/page.tsx @@ -44,7 +44,7 @@ export default function StepperForm() { const debouncedCheckOrgIdAvailability = useCallback( debounce(checkOrgIdAvailability, 300), - [checkOrgIdAvailability] + [checkOrgIdAvailability], ); useEffect(() => { @@ -278,7 +278,7 @@ export default function StepperForm() { function debounce any>( func: T, - wait: number + wait: number, ): (...args: Parameters) => void { let timeout: NodeJS.Timeout | null = null;