registerRouteWithAuth method
void
registerRouteWithAuth()
Registers an action with authorization in this objects REST server (service) by the given method and route.
method
the HTTP method of the route.route
the route to register in this object's REST server (service).schema
the schema to use for parameter validation.authorize
the authorization interceptoraction
the action to perform at the given route.
Implementation
void registerRouteWithAuth(
String method,
String route,
Schema schema,
FutureOr<Response?> Function(Request req, Future Function() next)?
authorize,
FutureOr<Response> Function(Request req) action) {
if (authorize != null) {
var nextAction = action;
action = _action(authorize, nextAction);
}
registerRoute(method, route, schema, action);
}