Authentication middleware that runs passive strategies and populates ctx.request.user. Always calls next() - it authenticates only, does not authorize.
Middleware function
// AuthPlugin registers this globally by default. Disable that registration// only when attaching authentication to selected routes yourself.app.register(AuthPlugin({ apiKey: { validate }, middleware: false }));app.router.get('/private', { middleware: [authMiddleware()], handler }); Copy
// AuthPlugin registers this globally by default. Disable that registration// only when attaching authentication to selected routes yourself.app.register(AuthPlugin({ apiKey: { validate }, middleware: false }));app.router.get('/private', { middleware: [authMiddleware()], handler });
Authentication middleware that runs passive strategies and populates ctx.request.user. Always calls next() - it authenticates only, does not authorize.