import { createFileRoute } from "@tanstack/react-router"; import { Check, Database, KeyRound, User } from "lucide-react"; import { useState } from "react"; import { useSession } from "@/lib/auth-client"; export const Route = createFileRoute("/_authenticated/oauth-consent")({ component: OAuthConsentPage, }); const SCOPES = [ { icon: Database, label: "Read your OpenSEO data", description: "Projects, keyword reports, and audit results.", }, { icon: KeyRound, label: "Act on your behalf via MCP", description: "Run tools and write results back to your workspace.", }, ]; function OAuthConsentPage() { const { data: session } = useSession(); const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); const userEmail = session?.user?.email ?? null; async function respond(accept: boolean) { setError(null); setIsSubmitting(true); const response = await fetch("/api/oauth/consent", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ accept, query: window.location.search, }), }); const data: { redirectTo?: string; error?: string; } = await response.json(); if (!response.ok) { setError(data.error ?? "Unable to complete authorization."); setIsSubmitting(false); return; } if (data.redirectTo) { window.location.assign(data.redirectTo); return; } setError("Authorization response did not include a redirect URL."); setIsSubmitting(false); } return (
OpenSEO

Authorize MCP access

An MCP client is requesting access to your OpenSEO workspace.

{userEmail ? (
Signed in as
{userEmail}
) : null}
This will allow it to
    {SCOPES.map((scope) => (
  • {scope.label}
    {scope.description}
  • ))}
{error ? (
{error}
) : null}

You can revoke access at any time in Settings.

); }