I'm using gRPC generated clients for dart and I need to add Authorization header to every request. I know there's ClientInterceptor but I want to ask if there is any way to call async method in interceptor's method because I have this async method for retrieving token:
static Future<String> getToken() async {
final CognitoAuthSession session = await Amplify.Auth.fetchAuthSession(
options: CognitoSessionOptions(getAWSCredentials: true)
);
return session.userPoolTokens.idToken;
}