Closed ocruzv closed 3 years ago
Thank you for the contribution. Can you please add a test case for this? If you have any trouble, please let me know and ill add this myself.
Sorry for doing this so slow, I have added the test case!
Thank you for taking the time to do it in the first place!
The changes in this PR are available in version 0.8.8
Sometimes we need to force the IdToken Refresh and we just realized that wasn't possible. Just added a parameter to the
refreshIdToken()
function to force the refresh, even if the token is still valid.Our use case:
When a new user is created, we trigger a firebase callable function to set custom claims in the firebase auth user, after setting these claims we need to refresh the idToken to start making requests with these custom claims set.
That's possible with the official library with
auth.currentUser.getIdToken(true)
, so, with firebase-auth-lite we can just doauth.refreshIdToken(true)
.There's no breaking changes.