WIP still, tuning up auth and room wildcard with middleware

This commit is contained in:
Nate Anderson
2025-02-02 19:49:11 -07:00
parent 37e168e46b
commit 544d3b45ba
18 changed files with 369 additions and 94 deletions
+3 -10
View File
@@ -1,15 +1,8 @@
// lib/routes/tasks/_middleware.dart
import 'package:backend/middleware/auth_middleware.dart';
import 'package:backend/middleware/logger.dart';
import 'package:dart_frog/dart_frog.dart';
import 'package:logging/logging.dart';
final log = Logger('');
Handler middleware(Handler handler) {
return handler.use(
(handler) => (context) async {
final request = context.request;
log.info('${request.method.value} ${request.uri.path}');
return await handler(context);
},
);
return handler.use(loggerMiddleware()).use(authenticatorMiddlewareProvider());
}