Posts

Showing posts from June, 2013

How to Handle OAuth::Unauthorized error for Omniauth provider?

Add this piece of code in your initializer file
Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter, twitter_consumer_key, twitter_consumer_secret end OmniAuth.config.on_failure = Proc.new { |env| OmniAuth::FailureEndpoint.new(env).redirect_to_failure } This will redirect user to the failure page, instead of showing an error.