Permalink
Browse files

third login(like google login, facebook login) appserver(vue) login b…

…ug verify
  • Loading branch information...
fancyecommerce committed Jan 11, 2019
1 parent c6cc9a9 commit 9606f675101cbacef62db31c92ff34122bf07bca
Showing with 6 additions and 5 deletions.
  1. +6 −5 services/Customer.php
@@ -580,7 +580,11 @@ protected function actionRegisterThirdPartyAccountAndLogin($user, $type)
if ($customer_one) {
$loginStatus = \Yii::$app->user->login($customer_one);
if ($loginStatus) {
return true;
$customer_one->generateAccessToken();
$customer_one->access_token_created_at = time();
$customer_one->save();
return $this->setHeaderAccessToken($customer_one->access_token);
}
// 不存在,注册。
} else {
@@ -596,10 +600,7 @@ protected function actionRegisterThirdPartyAccountAndLogin($user, $type)
];
$registerStatus = Yii::$service->customer->register($registerData);
if ($registerStatus) {
$loginStatus = Yii::$service->customer->login($registerData);
if ($loginStatus) {
return true;
}
return Yii::$service->customer->loginAndGetAccessToken($registerData['email'], $registerData['password']);
}
}

0 comments on commit 9606f67

Please sign in to comment.