I want to protect the routes and do the roles authorisation, and authentication in a react website. But I couldn’t find a fast way of doing it. I.e. Different buttons on the AppBar are hidden or shown based on the role of the user. But I couldn’t find anything that could help me achieve that apart from querying the database.
I’m protecting the routes currently using the roles authorisation, and authentication, which queries firebase database and firebase auth for the roles and the assigned user respectively.