Rails application that uses devise and omniauth for authentication. Only facebook users are permitted. Facebook login working well, omniauth call backs working well.
My Gemfile include the basic, among other:
gem 'devise'
gem 'omniauth'
gem 'omniauth-facebook'
In my "books" view controller, i've added devise authentication:
class BooksController < ApplicationController
before_filter :authenticate_user!
The problem: when user authenticate_user! fails, devise is redirecting to a sign_in page (where user type username, e-mail, password, confirmation). I do not want this behavior as I only want facebook users. I need devise to redirect to facebook login if authenticate_user fails.
How to make devise redirects to facebook login when user is not authenticated?