Discussions
How Do You Handle Authentication for Student Portals in React + Firebase Projects?
Hi everyone,
I’m working on a school project using React and Firebase to build a student portal system. Right now, I’m trying to figure out the best way to manage authentication for both students and admins.
My main questions are:
Is it better to use Firebase Authentication with custom claims to separate user roles (students vs. admins), or should I manage roles with Firestore rules?
How do you usually structure the login flow to redirect based on role?
Any tips on keeping the login state persistent across sessions, especially when using protected routes?
I’ve looked at a few tutorials, but they mostly cover basic login/signup flows. I’d really appreciate some insight or even examples from people who’ve built something similar in an educational setting.
Thanks in advance!