New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two or more identityClass models #5134
Comments
Nope, only a single identity class is supported. You should consider extending your different model classes from the common base identity class. |
Is it a good idea to extend base User Model and use three table for each model and mysql view for base User model? What is your view? Each of these models has too many different fields and i would not want to store all different data in one table. My idea is create mysql view table with base fields (username, password_hash etc.). Or it's have no sense and store all data in one table is good solution? |
It's totally fine that you have different kinds of user models which are stored in different tables or databases. However, if you want to support authentication using all these models, you should provide some common interface for them and have a way to differentiate them (e.g. introducing a user type). You may implement an identity class which creates different user models based on the given type information. |
Thanks |
can you provide more information on this? I am facing the same issue. |
@usualdesigner help me please!, how you resolved finally this problem? what's better option? |
As suggested, you should have a class user and then three classes one for each kind of user, related to user class with a user_Id field, for example |
Please give me the code solution for this issue. I have a Assignment to do. my DB has two tables, one for Tutor another one for users. users table is used to login to the system as student. and same goes for Tutor table. up to now students can login. but can't login Tutor. when I'm entering Tutor login details it goes to users login. this Assignment is kind of Student feedback portal. using Yii2. |
Is there way to use two or more identityClass for sign-in? I have three very different models (User, Manager, Member) and can I use all of these models as identityClass?
The text was updated successfully, but these errors were encountered: