amnah\yii2\user\controllers\AuthController::loginRegisterCallback PHP Method

loginRegisterCallback() public method

Login/register via social auth
public loginRegisterCallback ( BaseClient $client ) : Response
$client yii\authclient\BaseClient
return yii\web\Response
    public function loginRegisterCallback($client)
    {
        // uncomment this to see which attributes you get back
        //echo "<pre>";print_r($client->getUserAttributes());echo "</pre>";exit;
        // check if user is already logged in. if so, do nothing
        if (!Yii::$app->user->isGuest) {
            return;
        }
        // attempt to log in as an existing user
        if ($this->attemptLogin($client)) {
            return;
        }
        // register a new user
        $userAuth = $this->initUserAuth($client);
        $this->registerAndLoginUser($client, $userAuth);
    }