pick method

String pick(
  1. Webservice service
)

Returns the token value for the given service.

Throws an AuthException if no token is not found.

Implementation

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