432a1dec6a
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. |
||
---|---|---|
.. | ||
api | ||
auth.js | ||
example.js | ||
index.js |