registerRouteWithAuth method
void
registerRouteWithAuth(
- String method,
- String route,
- Schema schema,
- FutureOr<
Response?> authorize(- Request req,
- Future next()
- FutureOr<
Response> action(- Request req
inherited
Registers a route with authorization in HTTP endpoint.
method
HTTP method: 'get', 'head', 'post', 'put', 'delete'route
a command route. Base route will be added to this routeschema
a validation schema to validate received parameters.authorize
an authorization interceptoraction
an action function that is called when operation is invoked.
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 (endpoint == null) return;
route = _appendBaseRoute(route);
endpoint!.registerRouteWithAuth(method, route, schema, authorize, action);
}