@a83/orbiter-admin 0.3.22 → 0.3.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a83/orbiter-admin",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
4
4
  "description": "Standalone admin server for Orbiter CMS",
5
5
  "type": "module",
6
6
  "main": "./src/server.js",
package/src/server.js CHANGED
@@ -57,13 +57,12 @@ export function createApp(podPath) {
57
57
  credentials: true,
58
58
  }));
59
59
 
60
- app.use('/api/*', csrfMiddleware(ALLOWED_ORIGINS));
61
-
62
- // Public routes
60
+ // Public routes (no CSRF needed — login can't be meaningfully CSRF-attacked)
63
61
  app.route('/api/auth', authRoutes);
64
62
 
65
- // Protected routes
63
+ // Protected routes — CSRF + auth
66
64
  const api = new Hono();
65
+ api.use('*', csrfMiddleware(ALLOWED_ORIGINS));
67
66
  api.use('*', requireAuth);
68
67
  api.route('/collections', collectionRoutes);
69
68
  api.route('/collections', entryRoutes);