I have implemented devise and omniauth-facebook following the instructions below:
https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
Problem
My "facebook" callback function does get called.
If I uncomment the "facebook" function, error occurs. Routing seems to be working fine
However, the code inside the function does not seem to be executed.
The following code does not raise any error.
I have been looking in to this problem for days. Please help...
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
raise params.inspect
end
def failure
redirect_to root_path
end
end
Log
Finished "/cable/" [WebSocket] for ::1 at 2016-09-10 22:32:32 +0900
MessagesChannel stopped streaming from messages
Started GET "/cable" for ::1 at 2016-09-10 22:32:32 +0900
Started GET "/cable/" [WebSocket] for ::1 at 2016-09-10 22:32:32 +0900
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
MessagesChannel is transmitting the subscription confirmation
MessagesChannel is streaming from messages
Started GET "/users/auth/facebook" for ::1 at 2016-09-10 22:32:34 +0900
I, [2016-09-10T22:32:34.770050 #84008] INFO -- omniauth: (facebook) Request phase initiated.
Started GET "/users/auth/facebook" for ::1 at 2016-09-10 22:32:34 +0900
I, [2016-09-10T22:32:34.994734 #84008] INFO -- omniauth: (facebook) Request phase initiated.
Finished "/cable/" [WebSocket] for ::1 at 2016-09-10 22:32:35 +0900
MessagesChannel stopped streaming from messages
Started GET "/users/auth/facebook/callback?code=AQBICSjBfjCN7rGbCZLSkdg25FqTZGsnDrJi1UhBj0RwSQBjuZ5bTxEA025jApkwWiianigtILjRV5Uv067Yg73MGzi7sB5BT9yU0kjm7wzYzkBhWMmT0Aecw4ajACkSbBNfVUIii0cokommOAbSJgbzmfKRgbMGmdgYZsF6rBDuPyAGHnFgAa6bSl3jUmzW25SCTY9CDARiGlr880B-gwMs3gX0_KbtXnygAkBhNHoBSFFOIIY7w4QIMQHzZe1aLz6VWz_LxnuN88Ao8_lWOLPCfxsOWUJkdjYbLCowXmu1bpOu1zUuXSf6Dw9qBnWm73XvMyMD3iSasRRqlFW1uVde&state=2362c719c103b6b19f053ccc31b0b90ab34d137a71c2cb8d" for ::1 at 2016-09-10 22:32:40 +0900
I, [2016-09-10T22:32:40.549353 #84008] INFO -- omniauth: (facebook) Callback phase initiated.
Processing by Users::OmniauthCallbacksController#facebook as HTML
Parameters: {"code"=>"AQBICSjBfjCN7rGbCZLSkdg25FqTZGsnDrJi1UhBj0RwSQBjuZ5bTxEA025jApkwWiianigtILjRV5Uv067Yg73MGzi7sB5BT9yU0kjm7wzYzkBhWMmT0Aecw4ajACkSbBNfVUIii0cokommOAbSJgbzmfKRgbMGmdgYZsF6rBDuPyAGHnFgAa6bSl3jUmzW25SCTY9CDARiGlr880B-gwMs3gX0_KbtXnygAkBhNHoBSFFOIIY7w4QIMQHzZe1aLz6VWz_LxnuN88Ao8_lWOLPCfxsOWUJkdjYbLCowXmu1bpOu1zUuXSf6Dw9qBnWm73XvMyMD3iSasRRqlFW1uVde", "state"=>"2362c719c103b6b19f053ccc31b0b90ab34d137a71c2cb8d"}
Redirected to http://localhost:3000/
Filter chain halted as :authenticate_user! rendered or redirected
Completed 302 Found in 1ms (ActiveRecord: 0.0ms)
Versions
devise 4.2.0
omniauth 1.3.1
omniauth-oauth2 1.4.0
omniauth-facebook 4.0.0
rails 5.0.0.1