Settings

Theme

Question about Firebase, auth and react

3 points by macklemoreshair 5 years ago · 6 comments · 1 min read


I’ve been thinking through what has recently been the biggest pain in the ass in the recent react project I did, and id like to know if I’m crazy or if we did this wrong.

We have a few thousand lines of code specifically for managing users and a simple wrapper around our dynamo backend.

We couldn’t find a react component for login flows, so we build all this logic ourselves

- login page w/ social login - register page - logout - logic for redirecting you if you were already logged in - logic for redirecting you to login if you aren’t logged in - forgot password - verify - demo user account - notifying users of password requirements - handling failed registration - handling failed logins - handling google social login

We integrated with cognito and dynamo, but I think that even with firebase or aws amplify we would have had to write a lot of the logic ourselves.

Did we do something wrong? Is this just what you have to do to get logins and a per user backend working?

caryd 5 years ago

There are a million options for authentication already created and ready for use. Nearly every CMS has this ready for you on install. You could also go with active directory. You could also use the major ones that integrate with Google, fb, etc. Starting from scratch is fine but you'll have to use a ton of development time that could be better spent on your app.

  • macklemoreshairOP 5 years ago

    yes, we were using cognito in this case. but all of the logic even with integrating with one of these auth providers, took us a few weeks to get polished and right.

    the list i made about the different pages we had to build to get this to work correctly, it took one of our devs a few weeks to really get the login and account system and integrated with AWS cognito

gitgud 5 years ago

You're probably looking for "firebase-UI" it's a pretty good library which abstracts the sign in process and provides hooks for failures and successful sign-ins

https://www.npmjs.com/package/firebaseui

ericalexander2 5 years ago

Keycloak can handle all that.

https://www.keycloak.org/

docuru 5 years ago

With firebase sdk, they already handle all backend logic as your requirements. You will need to integrate with front end

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection