Ionic Angular Firebase phone authentication. Firebase idToken need to be added in heders eachtime for authenticated customers
I am trying to use firebase phone authentication in my ionic angular app. I am loving in to the app using firebase authentication at the beginning. After that, I do not want Customer need to login again and again. So I am checking if the user already logged in then get the new idToken for the customer. I need to pass the idToken as “FireBaseIdToken” in the backend service headers. printIdToken() function is printing the new toke perfectly. When I am trying to use callIdToken(), it is calling asynchronous way. I want it to wait for promis to complete then the returned value should be added in the header. I tried to use await inside callIdToken() , but it is not waiting for the promise. It need to wait for promise.