Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

fix(onboarding): added signout button in the bottom right corner (#68)

Sourabh Haldard7b3907f86aa
diff --git a/web/messages/en.json b/web/messages/en.json
index 9c2eaa858..9b6f224e6 100644
--- a/web/messages/en.json
+++ b/web/messages/en.json
@@ -58,7 +58,8 @@
"passwordRequired": "Password is required.",
"passwordTooShort": "Password must be at least 8 characters.",
"generic": "An error occurred. Please try again.",
- "emailNotConfirmed": "Please verify your email address first. Check your inbox for the confirmation link."
+ "emailNotConfirmed": "Please verify your email address first. Check your inbox for the confirmation link.",
+ "signOutError": "Failed to sign out. Please try again."
}
},
"dashboard": {
diff --git a/web/src/app/[locale]/(onboarding)/layout.tsx b/web/src/app/[locale]/(onboarding)/layout.tsx
index e31a624b4..fe6f88543 100644
--- a/web/src/app/[locale]/(onboarding)/layout.tsx
+++ b/web/src/app/[locale]/(onboarding)/layout.tsx
@@ -1,6 +1,7 @@
import { redirect } from "next/navigation";
import { createClient } from "@/lib/supabase/server";
import { AuthProvider } from "@/components/providers/auth-provider";
+import { OnboardingSignOutButton } from "@/components/auth/onboarding-sign-out-button";
export default async function OnboardingLayout({
children,
@@ -19,6 +20,7 @@ export default async function OnboardingLayout({
return (
<>
<AuthProvider user={user} />
+ <OnboardingSignOutButton />
{children}
</>
);
diff --git a/web/src/components/auth/onboarding-sign-out-button.tsx b/web/src/components/auth/onboarding-sign-out-button.tsx
new file mode 100644
index 000000000..fc07de54f
--- /dev/null
+++ b/web/src/components/auth/onboarding-sign-out-button.tsx
@@ -0,0 +1,39 @@
+'use client';
+
+import { useState } from 'react';
+import { useTranslations } from 'next-intl';
+import { LogOut } from 'lucide-react';
+import { toast } from 'sonner';
+import { createClient } from '@/lib/supabase/client';
+
+export function OnboardingSignOutButton() {
+ const tAuth = useTranslations('auth');
+ const [isSigningOut, setIsSigningOut] = useState(false);
+
+ const handleSignOut = async () => {
+ setIsSigningOut(true);
+
+ const supabase = createClient();
+ const { error } = await supabase.auth.signOut();
+
+ if (error) {
+ setIsSigningOut(false);
+ toast.error(tAuth('errors.signOutError'));
+ return;
+ }
+
+ window.location.href = '/sign-in';
+ };
+
+ return (
+ <button
+ type="button"
+ onClick={handleSignOut}
+ disabled={isSigningOut}
+ className="fixed bottom-6 right-6 z-50 flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50"
+ >
+ <LogOut className="h-3.5 w-3.5" />
+ {tAuth('signOut')}
+ </button>
+ );
+}