build method

  1. @override
Component build(
  1. BuildContext context
)
override

Implementation

@override
Component build(BuildContext context) {
  return Gate(
      child: Route(name,
          root: _CronJobEndpoint(
              resetPeriodOnExternalCall: resetPeriodOnExternalCall,
              name: name,
              timePeriod: timePeriod,
              onCall: onCall)),
      onRequest: (r) {
        if (r.context.cause != Cause.cronJobs && !allowExternal) {
          throw ForbiddenUnauthorizedException();
        }
        return r;
      });
}