Ejemplo n.º 1
0
 /**
  * @param OAuth2 $client
  */
 protected function onAuthSuccess($client)
 {
     $attributes = $client->getUserAttributes();
     $identity = new UserIdentity($attributes);
     if (Yii::$app->user->login($identity, $client->getAccessToken()->getExpireDuration())) {
         $identity->sid = $client->sessionId;
         $identity->saveToSession();
     }
 }