Graphorin API reference v0.4.0
Graphorin API reference / @graphorin/server / middleware / createAnonymousAuthMiddleware
Function: createAnonymousAuthMiddleware()
ts
function createAnonymousAuthMiddleware(): MiddlewareHandler<{
Variables: ServerVariables;
}>;Defined in: packages/server/src/middleware/auth.ts:38
Build the no-auth middleware mounted when auth.kind = 'none'. It stamps state.auth = { kind: 'anonymous', grantedScopes: [admin:*] } so the scope middleware, SSE handler and replay routes all treat the request as a fully-authorized principal. This is the documented trusted-loopback / single-operator mode — never mount it on a non-loopback deployment without understanding that every endpoint becomes open.
Returns
MiddlewareHandler<{ Variables: ServerVariables; }>