protected function attemptToConnectUser(User $user, $type)
    {
        $model = $this->getClientOrCreate($user, $type);

        if (! is_null($currentUser = $this->auth->user())) {
            $model->setAttribute('user_id', $currentUser->getAuthIdentifier());
        }

        $model->setAttribute('token', new Token(['access' => $user->token]));
        $model->save();

        return $model;
    }