Always allow anonymous organization creation in local/workos-off flows and remove the stale MCP_ENABLE_ANONYMOUS_OAUTH env hint so config reflects real MCP OAuth settings.
Unified · Split
| @@ -40,9 +40,8 @@ CONVEX_SITE_URL=https://your-deployment.convex.site · 39 unmodified lines | |||
| 40 | # EXECUTOR_WEB_PORT=5312 | 40 | # EXECUTOR_WEB_PORT=5312 |
| 41 | # ASSISTANT_PORT=3002 | 41 | # ASSISTANT_PORT=3002 |
| 42 | 42 | ||
| 43 | # ── MCP OAuth (optional) ── | 43 | # ── MCP OAuth for /mcp (optional) ── |
| 44 | # Set to 1 to enable self-issued anonymous OAuth even without WorkOS auth. | 44 | # MCP_AUTHORIZATION_SERVER=https://your-authkit-domain.authkit.app |
| 45 | # MCP_ENABLE_ANONYMOUS_OAUTH=1 | ||
| 46 | 45 | ||
| 47 | # ── Discord bot (optional — omit to skip bot startup) ── | 46 | # ── Discord bot (optional — omit to skip bot startup) ── |
| 48 | # DISCORD_BOT_TOKEN=... | 47 | # DISCORD_BOT_TOKEN=... |
| @@ -12,7 +12,7 @@ import { · 11 unmodified lines | |||
| 12 | DialogTitle, | 12 | DialogTitle, |
| 13 | } from "@/components/ui/dialog"; | 13 | } from "@/components/ui/dialog"; |
| 14 | import { useSession } from "@/lib/session-context"; | 14 | import { useSession } from "@/lib/session-context"; |
| 15 | import { anonymousDemoEnabled, workosEnabled } from "@/lib/auth-capabilities"; | 15 | import { workosEnabled } from "@/lib/auth-capabilities"; |
| 16 | 16 | ||
| 17 | const localSetupCommands = [ | 17 | const localSetupCommands = [ |
| 18 | "curl -fsSL https://executor.sh/install | bash", | 18 | "curl -fsSL https://executor.sh/install | bash", |
| @@ -85,13 +85,10 @@ export function NoOrganizationModal({ enabled }: { enabled: boolean }) { · 66 unmodified lines | |||
| 85 | variant="outline" | 85 | variant="outline" |
| 86 | className="w-full" | 86 | className="w-full" |
| 87 | onClick={handleCreateAnonymousOrganization} | 87 | onClick={handleCreateAnonymousOrganization} |
| 88 | disabled={creatingAnonymousOrganization || !anonymousDemoEnabled} | 88 | disabled={creatingAnonymousOrganization} |
| 89 | > | 89 | > |
| 90 | {creatingAnonymousOrganization ? "Creating anonymous organization..." : "Create anonymous organization"} | 90 | {creatingAnonymousOrganization ? "Creating anonymous organization..." : "Create anonymous organization"} |
| 91 | </Button> | 91 | </Button> |
| 92 | {!anonymousDemoEnabled ? ( | ||
| 93 | <p className="text-xs text-muted-foreground">Anonymous organization creation is disabled.</p> | ||
| 94 | ) : null} | ||
| 95 | <div className="relative py-1"> | 92 | <div className="relative py-1"> |
| 96 | <div className="absolute inset-0 flex items-center"> | 93 | <div className="absolute inset-0 flex items-center"> |
| 97 | <div className="w-full border-t border-border/60" /> | 94 | <div className="w-full border-t border-border/60" /> |
| @@ -1,2 +1 @@ | |||
| 1 | export const workosEnabled = Boolean(process.env.NEXT_PUBLIC_WORKOS_CLIENT_ID); | 1 | export const workosEnabled = Boolean(process.env.NEXT_PUBLIC_WORKOS_CLIENT_ID); |
| 2 | export const anonymousDemoEnabled = process.env.NEXT_PUBLIC_EXECUTOR_ALLOW_ANON_DEMO !== "0"; | ||
| @@ -10,7 +10,7 @@ import { · 9 unmodified lines | |||
| 10 | } from "react"; | 10 | } from "react"; |
| 11 | import { useMutation, useQuery as useConvexQuery } from "convex/react"; | 11 | import { useMutation, useQuery as useConvexQuery } from "convex/react"; |
| 12 | import { useQuery as useTanstackQuery } from "@tanstack/react-query"; | 12 | import { useQuery as useTanstackQuery } from "@tanstack/react-query"; |
| 13 | import { anonymousDemoEnabled, workosEnabled } from "@/lib/auth-capabilities"; | 13 | import { workosEnabled } from "@/lib/auth-capabilities"; |
| 14 | import { useWorkosAuthState } from "@/lib/convex-provider"; | 14 | import { useWorkosAuthState } from "@/lib/convex-provider"; |
| 15 | import { convexApi } from "@/lib/convex-api"; | 15 | import { convexApi } from "@/lib/convex-api"; |
| 16 | import { | 16 | import { |
| @@ -198,10 +198,6 @@ export function SessionProvider({ children }: { children: ReactNode }) { · 181 unmodified lines | |||
| 198 | }, []); | 198 | }, []); |
| 199 | 199 | ||
| 200 | const createAnonymousOrganization = useCallback(async () => { | 200 | const createAnonymousOrganization = useCallback(async () => { |
| 201 | if (!anonymousDemoEnabled) { | ||
| 202 | throw new Error("Anonymous organization creation is disabled"); | ||
| 203 | } | ||
| 204 | |||
| 205 | setRuntimeError(null); | 201 | setRuntimeError(null); |
| 206 | setCreatingAnonymousOrganization(true); | 202 | setCreatingAnonymousOrganization(true); |
| 207 | try { | 203 | try { |