Answer the question
In order to leave comments, you need to log in
How to authorize on the site through yii2/web/user?
The system uses a class - Yii2/web/user through which authorization occurs.
As far as I understand, the __id parameter, for example 1, is simply written to the session, and then it is subtracted from the corresponding table. When authorizing, everything is automatically deducted and you are on the site by iser with id = 1.
I need to add an additional check in order to read data from different tables, how can I do this?
Answer the question
In order to leave comments, you need to log in
the search for users is not done by the yii/web/User class, but by your class in the application that implements yii\web\IdentityInterface (which clings to yii/web/User). Accordingly, if you want to add some conditions for getting a user, you need to add them to the application class that implements IdentityInterface
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question