I was having an issue where the new Tweet form would not submit. It seems like it is being caused by the "Connect Another Twitter Account" button. In the tutorial this is a link_to but now with OmniAuth 2. 0 this has to be a button_to with a POST request, which seems to stop the form working. I assume it conflicts with the POST of the form itself.
Can anyone give advice on how to maintain this "Connect Another Twitter Account" functionality? For now I have had to remove the button entirely
I had the same issue. You need to request Elevated access for the Twitter API via the developer dashboard
Please help: The name, username and image values in the twitter_accounts table is NULL for me, suggesting the omniauth request is returning nil for these fields. The token and secret fields have populated correctly but I cannot get the name, username and image values.
Further context, I have spent a while trying to resolve this myself and have used Chris' own code in the omniauth_callbacks_controller to try to solve it.
Does anyone know what could be causing this data not to feed through whilst the token and secret data is working as expected?
In case useful for anyone, I had the same OAuth::Unauthorized 400 Bad Request TWICE and was struggling to diagnose the issue.
First time it was as simple as a typo within the omniauth.rb file - so check that first if you get 400. I was second-guessing that it was to do with the change to Oauth2.0 or something else.
Also, as it isn't shown explicitly in the tutorial and seems like Twitter have updated the interface within their developer section. When setting up the app select Oauth 1.0a, request email, Read and write. The 0auth 2.0 options did not work for me and gave me the '400 Bad Request' error but when I switched to 1.0a it went through fine