rsnext/examples/with-firebase-authentication/components
Joseph Knowles 432a1dec6a
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.
2020-08-05 08:38:26 +00:00
..
FirebaseAuth.js Fix with-firebase-authentication example: Update the cookie when ID token refreshes on client (#15628) 2020-08-05 08:38:26 +00:00