Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: Onboarding page redirect

Richie McIlroyf65d3badc10d
diff --git a/apps/web/app/dashboard/layout.tsx b/apps/web/app/dashboard/layout.tsx
index 33a2a3086..3cfc06b78 100644
--- a/apps/web/app/dashboard/layout.tsx
+++ b/apps/web/app/dashboard/layout.tsx
@@ -18,12 +18,16 @@ export default async function DashboardLayout({
}: {
children: React.ReactNode;
}) {
- const session = await getCurrentUser();
+ const user = await getCurrentUser();
- if (!session) {
+ if (!user) {
redirect("/login");
}
+ if (!user.name) {
+ redirect("/dashboard/onboarding");
+ }
+
// const supabase = await createSupabaseServerClient();
// const spaceData = await supabase
// .from("spaces")