controllers/SecurityController.php
public function connect(ClientInterface $client) {
        /** @var Account $account */
        $account = Yii::createObject(Account::className());
        $event = $this->getAuthEvent($account, $client);
        $this->trigger(self::EVENT_BEFORE_CONNECT, $event);
        $account->connectWithUser($client);
        $this->trigger(self::EVENT_AFTER_CONNECT, $event);
        $this->action->successUrl = Url::to(['/user/settings/networks']);
    }
public function connect(ClientInterface $client) {
        /** @var Account $account */
        $account = Yii::createObject(Account::className());
        $event = $this->getAuthEvent($account, $client);
        $this->trigger(self::EVENT_BEFORE_CONNECT, $event);
        $account->connectWithUser($client);
        $this->trigger(self::EVENT_AFTER_CONNECT, $event);
        $this->action->successUrl = Url::to(['/user/settings/networks']);
    }
Tries to connect social account to user.

@param ClientInterface $client