ssplugin / ss-twitter-feed

Show Recent twitter timeline on your site.
MIT License
3 stars 7 forks source link

Headers already sent - cannot get access token #21

Closed TUSAB-web closed 3 years ago

TUSAB-web commented 3 years ago

When I click the blue button to login to twitter, I am able to login, but when I authorize with twitter, I get an error about “headers already sent” - I tried again and get the same error each time.

 Error occurred while handling another error:
yii\web\HeadersAlreadySentException: Headers already sent in /var/www/html/vendor/ssplugin/ss-twitter-feed/src/controllers/OauthController.php on line 87. in /var/www/html/vendor/yiisoft/yii2/web/Response.php:366
Stack trace:
#0 /var/www/html/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /var/www/html/vendor/yiisoft/yii2/web/ErrorHandler.php(136): yii\web\Response->send()
#2 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(147): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#3 /var/www/html/vendor/yiisoft/yii2/base/ErrorHandler.php(135): craft\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#4 /var/www/html/vendor/craftcms/cms/src/web/ErrorHandler.php(63): yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#5 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#6 {main}
Previous exception:
yii\base\InvalidRouteException: Unable to resolve the request: ss-twitter-feed/oauth/callback&oauth_token=TgJKwQAAAAAA9e5BAAABdmeQq_8&oauth_verifier=xArzNOSPcm3F33xCRxydF1T0k0z41wXE in /var/www/html/vendor/yiisoft/yii2/base/Controller.php:151
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('callback&oauth_...', Array)
#1 /var/www/html/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('callback&oauth_...', Array)
#2 /var/www/html/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('ss-twitter-feed...', Array)
#3 /var/www/html/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction('ss-twitter-feed...', Array)
#4 /var/www/html/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#5 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#6 /var/www/html/web/index.php(22): yii\base\Application->run()
#7 {main}

Next yii\web\NotFoundHttpException: Page not found. in /var/www/html/vendor/craftcms/cms/src/web/Application.php:581
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#1 /var/www/html/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#2 /var/www/html/web/index.php(22): yii\base\Application->run()
#3 {main}
TUSAB-web commented 3 years ago

I had this problem in my local environment. I tried the same process on the server, and was able to get the token. One note - the URL generated doesn’t include https:.... it just has http - so this causes an error saying SSL required. I had to copy the link, then paste and add the ’s’ to http to get it to work.

ssplugin commented 3 years ago

@TUSAB-web

Thanks for addressing this issue. We have fixed this issue and also updated composer 2 compatibilities.