mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* feat(auth): add OAuth 2.1 provider for MCP connector support * fix(auth): rename redirect_u_r_ls column to redirect_urls * chore(db): regenerate oauth migration with correct column naming * fix(auth): reorder CORS headers and handle missing redirectURI * fix(auth): redirect to login without stale callbackUrl on account switch * chore: run lint * fix(auth): override credentials header on OAuth CORS entries * fix(auth): preserve OAuth flow when switching accounts on consent page * fix(auth): add session and user-id checks to authorize-params endpoint * fix(auth): add expiry check, credentials, MCP CORS, and scope in WWW-Authenticate * feat(mcp): add tool annotations for Connectors Directory compliance
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
'use client'
|
|
|
|
import { usePathname } from 'next/navigation'
|
|
import type { ThemeProviderProps } from 'next-themes'
|
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
|
|
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
|
|
const pathname = usePathname()
|
|
|
|
// Force light mode on public/marketing pages, allow user preference elsewhere
|
|
const isLightModePage =
|
|
pathname === '/' ||
|
|
pathname.startsWith('/login') ||
|
|
pathname.startsWith('/signup') ||
|
|
pathname.startsWith('/reset-password') ||
|
|
pathname.startsWith('/sso') ||
|
|
pathname.startsWith('/terms') ||
|
|
pathname.startsWith('/privacy') ||
|
|
pathname.startsWith('/invite') ||
|
|
pathname.startsWith('/verify') ||
|
|
pathname.startsWith('/careers') ||
|
|
pathname.startsWith('/changelog') ||
|
|
pathname.startsWith('/chat') ||
|
|
pathname.startsWith('/studio') ||
|
|
pathname.startsWith('/resume') ||
|
|
pathname.startsWith('/form') ||
|
|
pathname.startsWith('/oauth')
|
|
|
|
return (
|
|
<NextThemesProvider
|
|
attribute='class'
|
|
defaultTheme='dark'
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
storageKey='sim-theme'
|
|
forcedTheme={isLightModePage ? 'light' : undefined}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</NextThemesProvider>
|
|
)
|
|
}
|