findAliasesOfUser method
Searches for aliases associated with the current user.
This method retrieves a list of aliases associated with the current user (identified by the subject from the token provider).
Parameters:
pageSize(optional): The maximum number of aliases to return in the response. Defaults to 20.
Returns:
Throws:
- An Exception if the token provider is missing.
Implementation
Future<Iterable<AliasDoc>> findAliasesOfUser([int pageSize = 20]) async {
if (_tokenProvider == null) throw Exception('missing token provider');
final subject = _tokenProvider.subject;
final request = SearchAliasesRequest(pageSize: pageSize, subject: subject);
final response =
await _client.searchAliases(request, options: await _fetchOptions());
final entries = response.aliases.map(AliasDoc.new);
return entries;
}