I am breaking my head on how to get the refresh token from FirebaseAuth but cannot seem to find how.
On iOS, the equivalent is Auth.auth().currentUser?.refreshToken. Any help is highly appreciated.
I am breaking my head on how to get the refresh token from FirebaseAuth but cannot seem to find how.
On iOS, the equivalent is Auth.auth().currentUser?.refreshToken. Any help is highly appreciated.
 
    
    I think this is what Furkan meant to say:
Use the forceRefresh parameter. This force refreshes the token. Should only be set to true if the token is invalidated
    FirebaseAuth.getInstance().currentUser!!.getIdToken(true)
Read this answer for when you should use it: https://stackoverflow.com/a/48599373/1772057
 
    
    Read this answer https://stackoverflow.com/a/45427901/6534576
Maybe you solution is use the getIdToken listener.
getIdToken(true) only if you want refresh the token
getIdToken(false) if you only want get the current
code
user.getIdToken(true).addOnSuccessListener { result ->
      val token = result.token
}
 
    
    firebaseUser. getIdToken() reloads your token
