bloby-bot 0.53.0 → 0.53.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/supervisor/index.ts +10 -2
package/package.json
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -395,7 +395,9 @@ export async function startSupervisor() {
|
|
|
395
395
|
'GET /api/portal/validate-token',
|
|
396
396
|
'GET /api/onboard/status',
|
|
397
397
|
'GET /api/health',
|
|
398
|
-
'POST /api/onboard'
|
|
398
|
+
// NOTE: 'POST /api/onboard' is intentionally NOT blanket-exempt. It is gated in the
|
|
399
|
+
// request handler below: open on genuine first run (no portal_pass yet), token-required
|
|
400
|
+
// afterward. Re-onboard from the dashboard uses the internal x-internal WS path.
|
|
399
401
|
'GET /api/push/vapid-public-key',
|
|
400
402
|
'GET /api/push/status',
|
|
401
403
|
'POST /api/auth/claude/start',
|
|
@@ -1596,7 +1598,13 @@ mint();
|
|
|
1596
1598
|
// Auth check for mutation routes (POST/PUT/DELETE) — GET/HEAD are read-only, skip auth
|
|
1597
1599
|
const method = req.method || 'GET';
|
|
1598
1600
|
if (method !== 'GET' && method !== 'HEAD' && !isExemptRoute(method, req.url || '')) {
|
|
1599
|
-
|
|
1601
|
+
// POST /api/onboard is open only on genuine first run (no portal_pass yet). Read the
|
|
1602
|
+
// setting DIRECTLY rather than the 30s-cached isAuthRequired() so the gate closes the
|
|
1603
|
+
// instant onboarding sets a password — no stale-cache window for a takeover. The
|
|
1604
|
+
// dashboard's own re-onboard goes through the internal x-internal WS path (isInternal
|
|
1605
|
+
// above), so it never reaches here. All other routes keep using the cached check.
|
|
1606
|
+
const isOnboard = method === 'POST' && (req.url || '').split('?')[0] === '/api/onboard';
|
|
1607
|
+
const needsAuth = isOnboard ? !!getSetting('portal_pass') : await isAuthRequired();
|
|
1600
1608
|
if (needsAuth) {
|
|
1601
1609
|
const authHeader = req.headers['authorization'];
|
|
1602
1610
|
const token = authHeader?.startsWith('Bearer ') ? authHeader.slice(7) : null;
|