Twitter::Error::Unauthorized in Postscontroller#Create - Invalid or Expired Token

Why is the twitter oauth access token invalid / expired (rails 3)

Try changing this:

Twitter::Client.new(:token => provider.token, :secret => provider.secret) 

into this

Twitter::Client.new(:oauth_token => provider.token, :oauth_token_secret => provider.secret)

How to use Twitter gem in Rails, need small to figure out the whole thing?

Use client instead of Twitter.

You can see here how you should do it.

how can I get users to log in correctly on rails 3? instead of just getting redirected to the visitor front page

I would move the sign_in helper functions to ApplicationHelper so that you can use them in places other than the SessionsController.

After that, it should be very simple.

def sign_in_and_redirect user
sign_in user
redirect_to root_url # or wherever you want
end

It might even be easier to just do sign_in user and redirect_to root_url instead of using another helper.



Related Topics



Leave a reply



Submit