br-auth-middleware
Installation
SKILL.md
Better Route authentication middleware
Select authentication by client type, attach it as middleware, and mark every raw route as middleware-protected. Better Route 1.1 denies every raw route by default, including GET and OPTIONS.
use BetterRoute\Middleware\Jwt\Hs256JwtVerifier;
use BetterRoute\Middleware\Jwt\JwtAuthMiddleware;
$auth = new JwtAuthMiddleware(
verifier: new Hs256JwtVerifier(
secret: MY_PLUGIN_JWT_SECRET,
expectedIssuer: 'https://issuer.example',
expectedAudience: 'my-api',
maxLifetimeSeconds: 3600
),
requiredScopes: ['orders:read']
);