Add create team page
This commit is contained in:
@@ -31,6 +31,7 @@ import { Sheet, SheetContent, SheetTrigger } from "@unsend/ui/src/sheet";
|
||||
import { NextAuthProvider } from "~/providers/next-auth";
|
||||
import { getServerAuthSession } from "~/server/auth";
|
||||
import { NavButton } from "./nav-button";
|
||||
import { db } from "~/server/db";
|
||||
|
||||
export const metadata = {
|
||||
title: "Unsend",
|
||||
@@ -53,6 +54,16 @@ export default async function AuthenticatedDashboardLayout({
|
||||
redirect("/wait-list");
|
||||
}
|
||||
|
||||
const teamUser = await db.teamUser.findFirst({
|
||||
where: {
|
||||
userId: session.user.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (!teamUser) {
|
||||
redirect("/create-team");
|
||||
}
|
||||
|
||||
return (
|
||||
<NextAuthProvider session={session}>
|
||||
<div className="flex min-h-screen w-full h-full">
|
||||
|
Reference in New Issue
Block a user