title: OAuth consumer stopped working, where do I start debugging?
body: <p>I have a small Sinatra app that uses Twitter OAuth for authentication. Some time between October 8th and today, it stopped working.</p>
  
  <p>The symptom: I get redirected to Twitter, I sign in, I get redirected back to my app, but <strong>my app does not recognize me as logged in.</strong></p>
  
  <p>I can rule out my own code (haven't touched that in a month) and the platform (Heroku is managed, and all the requests look fine).</p>
  
  <p>The relevant part of the code is this (based on <a href="https://github.com/langalex/imonaplane/blob/749cf00ad7b8e77d3b8f3d1c8569ea508bc498ae/app.rb#L103" rel="nofollow">this code</a> by Alex Lang):</p>
  
  <pre class="lang-rb prettyprint-override"><code>get '/session_auth' do
    if params[:oauth_verifier]
      access_token = twitter_client.authorize(
        session[:request_token], session[:request_token_secret], oauth_verifier: params[:oauth_verifier])
      if twitter_client.authorized?
        user = db.load(User.to_id(twitter_client.info['screen_name'])) || User.new(login: twitter_client.info['screen_name'], twitter_access_token: access_token.token,
          twitter_secret_token: access_token.secret)
        db.save! user
        session[:user_id] = user.id
      end
    end
    redirect '/'
  end
  </code></pre>
  
  <p>How or where do you start debugging a thing like this?</p>