My mobile app built in Flutter uses google login to register users. From within this app I am calling a Firebase cloud function (called questionAnswer) using the Cloud Functions Plugin for Flutter.
If I understand correctly from this documentation, the https request should automatically include the Firebase authentication of the user.
How can I retrieve the authentication information of the user from within the Cloud Function? I need it in order to access data associated with that specific user in a Firebase Cloud Database. Should I include the google auth token as a parameter in the https request?
Here is my code in the Flutter app:
final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
functionName: 'questionAnswer',
);
fetchHttps() async {
dynamic resp = await callable.call();
print(resp);
}
This is the code in the Cloud Function
exports.questionAnswer = functions.https.onCall(() => {
console.log('addNumbersLog', "holaLog");
return answer;
});