getBearerToken method
- LocalDatabase localDatabase
Implementation
@protected
Future<String> getBearerToken(LocalDatabase localDatabase) async {
final MaybeError<String> token = await ProductQuery.getPriceToken(
getUser(),
localDatabase,
);
if (token.isError) {
throw Exception('Could not get token: ${token.error}');
}
if (token.value.isEmpty) {
throw Exception('Unexpected empty token');
}
return token.value;
}