Initial commit from agent-native create

This commit is contained in:
agent-native
2026-07-25 17:10:38 +00:00
commit ffea2aeff7
120 changed files with 6804 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { runAuthGuard } from "@agent-native/core/server";
/**
* Global auth middleware — runs for ALL requests (page routes, API routes,
* framework routes). The auth plugin configures the guard; this middleware
* enforces it on every request.
*
* Without this, auth only runs for /_agent-native/* routes because the
* framework handler's middleware registry is scoped to that catch-all.
* Page routes (/, /settings) and API routes (/api/*) would bypass auth.
*/
import { defineEventHandler } from "h3";
export default defineEventHandler(async (event) => {
return runAuthGuard(event);
});