S
S
Sergey Beloventsev2017-08-31 16:58:58
Yii
Sergey Beloventsev, 2017-08-31 16:58:58

How to insert password_hash into user model?

There is a need to organize user registration through the restfull api, the essence of which is that the user goes from the main site to the partner site and the email under which he is registered on the main site is transmitted via the link. After that, the user with the same email is registered, and if not, a request is made from the partner site to the rest of the main site. And I get the following data
{
"auth_key": "EGDPlc2Ctu4EqO0jdAeLQHp0tMoTRxBF",
"password_hash": "$3y$15$87bwkU8Nmc1oFSpPZeswo.M1W11zbNp2vhТeG2WzXvg/nAtyyQLjq",
"email": "[email protected]",
"Vladimir":
" last_name": "Priorev",
"phone": 79111111111,
"
Then it is stored in the response variable and saved like this new User($response) and both auth_key and password_hash change. Don't tell me why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-08-31
@Sergalas

And you show the User model code and what happens after new User($response).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question