skip to Main Content

Suppose, I have two users on this App (Teacher & Student). Their platform or home screen is different and so is the login, and registration section. Now I want the login status (student or teacher) to compare the splash screen to see who has the login and send it to its home screen. How can do this?enter image description here

2

Answers


  1. You can make role-based authorization. Here is an example.

    Login or Signup to reply.
  2. You need to assign a role each user, and then do the routing based on the role.
    2 places where you can store the role information:

    • In the Firebase Authentication token of that user as a custom claim
    • In the database, either as a document associated with that user or in a table if you’re using SQL. Please create a different table to store user details and use the user id as a foreign key. Do not mess with the tables generated by the authentication provider.

    Always set the role from a trusted environment, otherwise your users will be able to change their own roles.

    Once this is done, you can access the role information from your app and do role based authorization (in your case, routing)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search