Twitter::Error::Unauthorized in PostsController#create - Invalid or expired token
Why does "create" throw me an invalid/expired token error? The users are able to log in just fine (so they are authenticated properly) but when they try to create a post, I get this error. I'm using Omniauth gem (v1.1.4) for authentication and Twitter gem (v4.6.2) for the posting to Twitter. The Omniauth-twitter gem is v0.0.16 if that matters. This is the code that is causing me an error class PostsController < ApplicationController def create Twitter::Client.new.update(@post.content) end end This is part of the user model (user.rb) def twitter unless @twitter_user provider = self