Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Implement session check in DemoSignupBanner to prevent rendering for logged-in users

Bill Yang3fd4f245cf70
diff --git a/client/src/app/[site]/components/Header/DemoSignupBanner.tsx b/client/src/app/[site]/components/Header/DemoSignupBanner.tsx
index 8012c0cbc..87e49faa0 100644
--- a/client/src/app/[site]/components/Header/DemoSignupBanner.tsx
+++ b/client/src/app/[site]/components/Header/DemoSignupBanner.tsx
@@ -4,8 +4,14 @@ import { ArrowRight, Sparkles } from "lucide-react";
import Link from "next/link";
import { Button } from "../../../../components/ui/button";
import { DEMO_HOSTNAME } from "../../../../lib/const";
+import { authClient } from "../../../../lib/auth";
export function DemoSignupBanner() {
+ const session = authClient.useSession();
+ if (session.data) {
+ return null;
+ }
+
// Only show on demo.rybbit.com and not in an iframe
if (typeof window === "undefined" || window.location.host !== DEMO_HOSTNAME) {
return null;