colinhacks/next-firebase-ssr

How could Firebase claims be used with this implementation?

RichardSPrins opened this issue · 1 comments

I am using Firebase auth and Firestore for my app, and basically used the same flow as described/used in this repo, but I have 2 types of users and will have 2 types of UI depending on the user role. Default role will be a student, but in the event they upgrade to a Stripe subscription, they assume the role of coach and can take on students of their own. I have found that claims are the best way to implement this, but aside from that knowledge, actually using them properly is a concept that still escapes me.

This goes outside of the framework of this example and something you should ask on stackoverflow.

but when you fetch data from firestore you would get the "role" of the user and provide logic based on that.

if student then show this component
if coach then show this other component.