before method

  1. @override
FutureOr<void> before(
  1. RouteBase route
)
override

Implementation

@override
FutureOr<void> before(RouteBase route) {
    final metadataAuthInfo = getAuthInfo(route, "basic");
    for (var info in metadataAuthInfo) {
        final authName = info["name"];
        final basicAuthInfo = authInfo[authName];
        if(basicAuthInfo != null) {
            route.basicAuth(basicAuthInfo.username, basicAuthInfo.password);
            break;
        }
    }
    return super.before(route);
}