The action 'redirect_callbacks' could not be found for Users::OmniauthCallbacksController
<p>I have a problem with omniauth and devise_token_auth. When i try to register an user with facebook, the callback not working.</p>

<p>Her's my <strong>Gemfile</strong> :</p>

<pre><code>gem 'rack-cors', :require =&gt; 'rack/cors'
gem 'devise_token_auth'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'devise', '~&gt; 3.2'
</code></pre>

<p><strong>Routes.rb</strong></p>

<pre><code>Rails.application.routes.draw do
  namespace :api, defaults: { format: :json } do
       scope :v1 do
         mount_devise_token_auth_for 'User', at: 'auth', :controllers =&gt; { :omniauth_callbacks =&gt; "users/omniauth_callbacks" }
         match 'auth/:provider/callback', to: 'sessions#create', via: [:get, :post]
      end
  end
  root to:'welcomes#index'
end
</code></pre>

<p>Here's the <strong>app/controllers/users/omniauth_callbacks_controller.rb</strong></p>

<pre><code>class Users::OmniauthCallbacksController &lt; Devise::OmniauthCallbacksController
  def facebook
    # You need to implement the method below in your model (e.g. app/models/user.rb)
    @user = User.from_omniauth(request.env["omniauth.auth"])

    if @user.persisted?
      sign_in_and_redirect @user, :event =&gt; :authentication #this will throw if @user is not activated
      set_flash_message(:notice, :success, :kind =&gt; "Facebook") if is_navigational_format?
    else
      session["devise.facebook_data"] = request.env["omniauth.auth"]
      redirect_to new_user_registration_url
    end
  end

  def failure
    redirect_to root_path
  end
end
</code></pre>

<p><strong>config/initializers/omniauth.rb</strong></p>

<pre><code>Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, "XXX", "XXX",
  :scope =&gt; 'public_profile,email,user_birthday',
  :info_fields =&gt; 'id,about,birthday,email,first_name,gender,last_name'
end
</code></pre>

<p>And finally, this is the console response :</p>

<pre><code>Started GET "/api/v1/auth/facebook" for 192.168.33.1 at 2016-05-14 10:26:00 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255


Started GET "/omniauth/facebook?resource_class=User" for 192.168.33.1 at 2016-05-14 10:26:00 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
I, [2016-05-14T10:26:00.995076 #3226]  INFO -- omniauth: (facebook) Request phase initiated.


Started GET "/omniauth/facebook/callback?code=XXX" for 192.168.33.1 at 2016-05-14 10:26:01 +0000
Cannot render console from 192.168.33.1! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
I, [2016-05-14T10:26:01.130357 #3226]  INFO -- omniauth: (facebook) Callback phase initiated.

AbstractController::ActionNotFound (The action 'redirect_callbacks' could not be found for Users::OmniauthCallbacksController):
</code></pre>

<p>Am I missing something simple? I've been searching for a solution for the last few day</p>