I am trying to create a Rails 5 API only app to create signin functionality with Facebook.
I am using the following gems:
devise_token_auth
omniauth_facebook
I have followed documentation on devise_token_auth to create the app. The demo app provided by them also have similar error.
I am able to sign in successfully. User's receiving token, it is increasing sign_in_count but after that callback is going to http://localhost:8000/auth/facebook/callback#_=_ with a blank page.
Below is the console log of the requests:
Started GET "/omniauth/facebook?resource_class=User" for 127.0.0.1 at <timestamp>
I, [2017-10-05T18:10:34.005009 #21485] INFO -- omniauth: (facebook) Request phase initiated.
Started GET "/omniauth/facebook/callback?code=<code>" for 127.0.0.1 at <timestamp>
I, [2017-10-05T18:10:34.402585 #21485] INFO -- omniauth: (facebook) Callback phase initiated.
Processing by DeviseTokenAuth::OmniauthCallbacksController#redirect_callbacks as HTML
Parameters: {"code"=>"<code>", "state"=>"<state>", "provider"=>"facebook"}
Redirected to http://localhost:8000/auth/facebook/callback
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Started GET "/auth/facebook/callback" for 127.0.0.1 at <timestamp>
Processing by DeviseTokenAuth::OmniauthCallbacksController#omniauth_success as HTML
Parameters: {"provider"=>"facebook"}
User Load (0.4ms) SELECT <SQL QUERY>
(0.2ms) begin transaction
SQL (3.8ms) UPDATE <SQL QUERY>
(388.3ms) commit transaction
(0.1ms) begin transaction
(0.1ms) commit transaction
Completed 200 OK in 566ms (Views: 0.2ms | ActiveRecord: 394.6ms)
I have also added omniauth_callbacks_controller.rb but it has no effect.