I have a classic omniauth problem, when trying to access the '/auth/twitter'.
The problem with the other solutions out there is that I can't remove :omniauthable from user.rb, because the facebook authentication won't work.
Also, If I remove the devise lines below, the twitter authentication works. It seems that there is a compatibility problem between twitter and facebook with omniauth, does anyone have a solution?
Thanks
devise.rb
require "omniauth-facebook"
config.omniauth :facebook, FACEBOOK_APP_ID, FACEBOOK_APP_SECRET
Gemfile
# Users from facebook
gem 'omniauth'
gem 'omniauth-facebook'
omniauth.rb
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET
end
models/user.rb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:confirmable, :omniauthable, omniauth_providers: [:facebook]
end