token method

Token token(
  1. Webservice service
)

Returns the Token for the given service.

Implementation

Token token(Webservice service) {
  return firstWhere(
    (token) => token.webservice == service,
    orElse: () => throw AuthException(
      '',
      service,
      message: (reason, webservice) {
        return 'AuthException: No token found for ${webservice.name}';
      },
    ),
  );
}