I'm having a pretty bizarre and frustrating problem with Twitter's API. The oauth process is working just fine locally but once I put the site on heroku it automatically adds the url of the testing server and redirects to a broken page. This is the code:
def oauth
oauth = Twitter::OAuth.new('*','*')
request_token = oauth.request_token(:oauth_callback => 'http://strong-ice-53.heroku.com/callback')
session[:request_token] = request_token.token
session[:request_token_secret] = request_token.secret
session[:returnurl] = params[:returnurl]
redirect_to request_token.authorize_url
end
Locally http://strong-ice-53.heroku.com/oauth sends me to api.twitter.com/... just fine. but once online it sends me to http://strong-ice-53.heroku.comapi.twitter.com/... which gives me an error.
I've tried chomping the redirect but that doesn't seem to work:
redirect_to request_token.authorize_url.chomp("strong-ice-53.heroku.com")
Any help would be greatly appreciated. I'm a noob to all of this.