Fix with-firebase-authentication example: Update the cookie when ID token…
Fix with-firebase-authentication example: Update the cookie when ID token refreshes on client (#15628) I noticed a problem with the example - when you leave it logged in for more than an hour it breaks. The example API call starts to fail with `auth/id-token-expired`. Looking at the code I saw that we never update the id token after signing in, but firebase automatically updates it every hour, meaning our `verifyIdToken` fails after an hour. So I used the `onIdTokenChanged` function from firebase to update the cookie every time the id token changes. I'm open to suggestions on refactoring the code I've added.
Showing
Please
register
or
sign in
to comment