Redwood: Firebase: Generator

Created on 2 Jun 2020  路  6Comments  路  Source: redwoodjs/redwood

Follow what's done for Netlify and auth0 to provide Firebase's generator.

Most helpful comment

@thedavidprice @peterp
PR is ready for review: https://github.com/redwoodjs/redwood/pull/643#issue-426443234

All 6 comments

@thedavidprice @peterp
PR is ready for review: https://github.com/redwoodjs/redwood/pull/643#issue-426443234

I've just tried setting up Firebase using the Generator and Doc.

A few things to report:
The firebase-admin package was not installed on the API workspace after the generator was run

The following line was added to the auth.js lib :
const { email, uid } = await adminApp.auth().verifyToken(token)
But the function name is verifyIdToken not verifyToken

The "Firebase Google sign-in" language was a little confusing, Firebase being a Google company, I didn't get that only signing in with a Google account was possible. So I only checked the Email/Password option in Firebase and didn't get what my issue was for a while.

After fixing those, I got it working, thanks for your contribution

Thanks for the feedback @FiveBoroughs

We may need some more work on this, I'm getting a lot of these errors:
image

If you browse the website without refreshing any page and the token expires (1h), the verifyIdToken function will throw an exception and the whole frontend will go into "Something went wrong" mode

Hmmm... Ok, I can take a look at how it's implemented on the client side.

@FiveBoroughs I noticed it but it happens every few days or so on my app, because of code splitting.
I'd expect it to be a problem common to all Auth providers though and indeed a way to handle it in front would be awesome

Was this page helpful?
0 / 5 - 0 ratings

Related issues

freddydumont picture freddydumont  路  3Comments

slavakurilyak picture slavakurilyak  路  4Comments

cannikin picture cannikin  路  3Comments

wispyco picture wispyco  路  3Comments

thedavidprice picture thedavidprice  路  3Comments