I have multiple roles for user login, I have successfully implemented if one user has only one role but the problem is if a user have more than one role then how can I implement that.
Thanks and Regards Prabhat Pandit.
CodePudding user response:
One is: You can ask from a user at runtime that by which role he/she want to login.
Second is: At the login time let the user select from drop down that by which role he/she want to login.
CodePudding user response:
It should depend on your login response. Let's assume user login using his/her credentials then role of user should be in response and accordingly you can navigate to respective screen. I have mentioned below Login response. For Admin user: { "user_role":"admin" }
For normal user: { "User_login":"user" }
