authSuccess() protected method

This method is invoked in case of successful authentication via auth client.
protected authSuccess ( yii\authclient\ClientInterface $client ) : Response
$client yii\authclient\ClientInterface auth client instance.
return yii\web\Response response instance.
Exemplo n.º 1
0
 /** @inheritdoc */
 protected function authSuccess($client)
 {
     if (!is_callable($this->successCallback)) {
         $this->successCallback = [$this, 'onAuthSuccess'];
         parent::authSuccess($client);
     } else {
         /** @var OAuth2 $client */
         $this->onAuthSuccess($client);
         parent::authSuccess($client);
     }
 }
Exemplo n.º 2
0
 protected function authSuccess($client)
 {
     /** @var \yii\authclient\BaseClient $client */
     $this->socialServiceId = SocialService::classNameToId($client->className());
     if ($this->socialServiceId === 0) {
         throw new ServerErrorHttpException("SocialService unknown");
     }
     // first find user service on this id
     $userAttributes = $client->getUserAttributes();
     $this->serviceId = $userAttributes['id'];
     //! @todo Add caching here based on commonTag
     $this->userService = UserService::find()->where(['service_id' => $this->serviceId, 'social_service_id' => $this->socialServiceId])->one();
     return parent::authSuccess($client);
 }
Exemplo n.º 3
0
 /**
  * @inheritdoc
  */
 public function authSuccess($client)
 {
     return parent::authSuccess($client);
 }