From fba4c411dcd6aba0f643118c3a01a478b3256fd5 Mon Sep 17 00:00:00 2001 From: Benjamin Boenisch Date: Sun, 15 Feb 2026 23:37:43 +0100 Subject: [PATCH] fix(sdk): auto-select role on direct SDK URL access instead of redirecting When accessing SDK pages directly (e.g. /sdk/gci) without a stored role, the layout now auto-selects 'developer' instead of redirecting to '/', which on port 3002 would hit bp-lehrer-admin and bounce to /dashboard. Co-Authored-By: Claude Opus 4.6 --- admin-compliance/app/(sdk)/layout.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin-compliance/app/(sdk)/layout.tsx b/admin-compliance/app/(sdk)/layout.tsx index fb78d27..a2dfcea 100644 --- a/admin-compliance/app/(sdk)/layout.tsx +++ b/admin-compliance/app/(sdk)/layout.tsx @@ -8,7 +8,7 @@ import { CommandBar } from '@/components/sdk/CommandBar' import { SDKPipelineSidebar } from '@/components/sdk/SDKPipelineSidebar' import { ComplianceAdvisorWidget } from '@/components/sdk/ComplianceAdvisorWidget' import { useSDK } from '@/lib/sdk' -import { getStoredRole } from '@/lib/roles' +import { getStoredRole, storeRole } from '@/lib/roles' // ============================================================================= // SDK HEADER @@ -151,10 +151,10 @@ export default function SDKRootLayout({ // Check if role is stored (auth check) const role = getStoredRole() if (!role) { - router.replace('/') - } else { - setLoading(false) + // Auto-select developer role for direct SDK URL access + storeRole('developer') } + setLoading(false) }, [router]) if (loading) {