I am reading some Json files from a firebase database, and I am trying to get the ID token for the current user, which will be used in the header as follows:
var response = await httpClient.get(url,headers: {'Authorization':"Bearer ${FirebaseAuth.instance.currentUser.getToken()}"});
when I do the previous line, it seems that it is not getting the correct token, since I cannot access the database, however, when I manually include the ID token in the line, my application works as intended. What exactly am I doing wrong?
source
share