M
M
McMike2017-03-20 12:37:50
Yii
McMike, 2017-03-20 12:37:50

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

2 answer(s)
M
Maxim Fedorov, 2017-03-20
@McMike

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

D
Dmitry, 2017-03-20
@slo_nik

Good morning.
Here are two links to the documentation, where everything is described
One
Two

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question