I think you can override the default on_failure behavior in your omniauth configuration, I do not use devise, but I use omniauth-facebook gem and was successful with variations:
OmniAuth.config.on_failure = Proc.new { |env| OmniAuth::FailureEndpoint.new(env).redirect_to_failure }
or something more ordinary:
OmniAuth.config.on_failure do |env| new_path = "#{env['SCRIPT_NAME']}#{OmniAuth.config.path_prefix}/failure?message=#{error_type}" [302, {'Location' => new_path, 'Content-Type'=> 'text/html'}, []] end
source share