diff --git a/docs/app/docs/layout.tsx b/docs/app/docs/layout.tsx
index 4dfbae8e0d..dfeda22a97 100644
--- a/docs/app/docs/layout.tsx
+++ b/docs/app/docs/layout.tsx
@@ -3,6 +3,7 @@ import Link from 'next/link'
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
import { GithubIcon } from 'lucide-react'
import { source } from '@/lib/source'
+import { AgentIcon } from '@/components/icons'
const GitHubLink = () => (
@@ -23,7 +24,12 @@ export default function Layout({ children }: { children: ReactNode }) {
+
+ Sim Studio
+
+ ),
}}
>
{children}
diff --git a/docs/content/docs/execution/index.mdx b/docs/content/docs/execution/index.mdx
index ddbb96c926..2a5e18f136 100644
--- a/docs/content/docs/execution/index.mdx
+++ b/docs/content/docs/execution/index.mdx
@@ -1,6 +1,6 @@
---
title: Execution
-description: The execution of a workflow.
+description: Sim Studio provides a powerful execution engine that brings your workflows to life. Understanding how execution works will help you design more effective workflows and troubleshoot any issues that arise..
---
import { Card, Cards } from 'fumadocs-ui/components/card'
@@ -10,10 +10,6 @@ import { Accordion, Accordions } from 'fumadocs-ui/components/accordion'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { AgentIcon, ApiIcon, ConditionalIcon, CodeIcon, ChartBarIcon, ConnectIcon, GmailIcon, PerplexityIcon, NotionIcon, ExaAIIcon, FirecrawlIcon, SlackIcon } from '@/components/icons'
-# Workflow Execution
-
-Sim Studio provides a powerful execution engine that brings your workflows to life. Understanding how execution works will help you design more effective workflows and troubleshoot any issues that arise.
-
## Execution Flow
When you execute a workflow in Sim Studio, the system follows a predictable pattern:
diff --git a/sim/app/middleware.ts b/sim/app/middleware.ts
deleted file mode 100644
index fa2ea28465..0000000000
--- a/sim/app/middleware.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { NextRequest, NextResponse } from 'next/server'
-
-export async function middleware(request: NextRequest) {
- // Check if the path is exactly /w
- if (request.nextUrl.pathname === '/w') {
- return NextResponse.redirect(new URL('/w/1', request.url))
- }
-
- // Skip auth check if DISABLE_AUTH is set (for standalone mode)
- if (process.env.DISABLE_AUTH === 'true' || process.env.NEXT_PUBLIC_DISABLE_AUTH === 'true') {
- return NextResponse.next()
- }
-
- const cookieHeader = request.headers.get("cookie");
- const cookies = cookieHeader?.split("; ").reduce((acc, cookie) => {
- const [key, value] = cookie.split("=");
- acc.set(key, value);
- return acc;
- }, new Map());
-
- const sessionCookie =
- cookies?.get("better-auth.session_token") ||
- cookies?.get("__Secure-better-auth.session_token");
-
- if (!sessionCookie) {
- return NextResponse.redirect(new URL('/login', request.url))
- }
- return NextResponse.next()
-}
-
-// TODO: Add protected routes
-export const config = {
- matcher: [
- '/w', // Match exactly /w
- '/w/:path*', // Keep existing matcher for protected routes
- ],
-}
diff --git a/sim/middleware.ts b/sim/middleware.ts
index c9f311e43a..b4989e45c0 100644
--- a/sim/middleware.ts
+++ b/sim/middleware.ts
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server'
+import { getSessionCookie } from "better-auth/cookies"
export async function middleware(request: NextRequest) {
// Check if the path is exactly /w
@@ -11,18 +12,7 @@ export async function middleware(request: NextRequest) {
return NextResponse.next()
}
- const cookieHeader = request.headers.get("cookie");
- const cookies = cookieHeader?.split("; ").reduce((acc, cookie) => {
- const [key, value] = cookie.split("=");
- acc.set(key, value);
- return acc;
- }, new Map());
-
- const sessionCookie =
- cookies?.get("better-auth.session_token") ||
- cookies?.get("__Secure-better-auth.session_token");
-
- // Existing auth check for protected routes
+ const sessionCookie = getSessionCookie(request)
if (!sessionCookie) {
return NextResponse.redirect(new URL('/login', request.url))
}