fix(sdk): auto-select role on direct SDK URL access instead of redirecting
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 35s
CI / test-python-backend-compliance (push) Successful in 28s
CI / test-python-document-crawler (push) Successful in 26s
CI / test-python-dsms-gateway (push) Successful in 17s

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 <noreply@anthropic.com>
This commit is contained in:
Benjamin Boenisch
2026-02-15 23:37:43 +01:00
parent 7a09086930
commit fba4c411dc

View File

@@ -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) {