diff --git a/src/controllers/AuthController.php b/src/controllers/AuthController.php index 54752a2..1600dd5 100644 --- a/src/controllers/AuthController.php +++ b/src/controllers/AuthController.php @@ -78,17 +78,17 @@ public function onAuthSuccess($client) //Если соц сеть вернула нам email то на него можно опираться. if ($emailFromAuthClient = ArrayHelper::getValue($attributes, 'email')) { //Нашли email - $userEmailModel = CmsUserEmail::find()->where(['value' => $emailFromAuthClient]) + $userEmailModel = CmsUserEmail::find()->cmsSite()->where(['value' => $emailFromAuthClient]) //->andWhere(['approved' => Cms::BOOL_Y]) ->one(); if ($userEmailModel) { - if ($userEmailModel->user) { - $user = $userEmailModel->user; + if ($userEmailModel->cmsUser) { + $user = $userEmailModel->cmsUser; } } if (!$user) { - $user = CmsUser::find()->where(['email' => $emailFromAuthClient])->one(); + $user = CmsUser::find()->cmsSite()->email($emailFromAuthClient)->one(); } }