firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

getIdToken(true) is not returning a new token

Open octaviodivy opened this issue 2 years ago • 2 comments

[REQUIRED] Environment info

firebase-tools: 11.5.0

Platform: Windows 10

Node: 14.20.0

[REQUIRED] Test case

let token1 = await firebase.auth().currentUser.getIdToken(true)
await firebase.auth().currentUser.updateEmail("[email protected]")
let token2 = await firebase.auth().currentUser.getIdToken(true)

token1 == token2

[REQUIRED] Steps to reproduce

On localhost, against the Auth emulators:

  • In a Firebase project with firebase Auth working, authenticate with phone
  • Invoke the getIdToken(true) to force refresh the token
  • Update e-mail (which forces token to be revoked)
  • Invoke the getIdToken(true) to force refresh the token

[REQUIRED] Expected behavior

  • Being able to retrieve a new valid token as the old one had been revoked by e-mail update

[REQUIRED] Actual behavior

Code running on emulator: image

Code running on firebase production: image

octaviodivy avatar Aug 10 '22 18:08 octaviodivy

The same is happening here, but I use the macOS plataform

diegodulval avatar Aug 10 '22 18:08 diegodulval

I'm on macOS, firebase-tools v11.5.0, node 14 and using JSSDK v9 (it seems like you're using v8 based on the syntax and that I know of, the refresh logic hasn't changed significantly since v8), but unfortunately, I'm not able to reproduce this.

Could I get a bit more information about how you're doing phone auth? Are you also seeing any errors in your console when you did any of the steps (e.g. during phone auth, while refreshing the token, etc)?

lisajian avatar Aug 16 '22 00:08 lisajian

Hey @octaviodivy. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Aug 24 '22 01:08 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@octaviodivy if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Aug 29 '22 01:08 google-oss-bot

Have the same issue without an emulator

zhebil avatar Nov 23 '22 19:11 zhebil

Having same issue here. Token is revoked and I cant generate new ones

petem24 avatar Jan 26 '23 10:01 petem24

Hi folks. If you are seeing similar issue, please feel free to file a new issue. Would appreciate if you can include reproduction steps or firebase debug logs along with the issue. Thanks.

taeold avatar Jan 31 '23 18:01 taeold