я реализовал Разрабатывают и OmniAuth-facebook, следуя инструкциям ниже:OmniAuth-facebook + изобрести обратный вызов не получает казнены
https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview
Проблема
Мой "facebook" Функция обратного вызова делает получить называется.
Если я раскомментирую функцию «facebook», возникает ошибка. Маршрутизация работает нормально
Однако код внутри функции не работает.
Следующий код не вызывает ошибок.
Я искал эту проблему в течение нескольких дней. Пожалуйста, помогите ...
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def facebook
raise params.inspect
end
def failure
redirect_to root_path
end
end
Входа
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 "https://stackoverflow.com/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 "https://stackoverflow.com/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 "https://stackoverflow.com/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)
Версия
devise 4.2.0
omniauth 1.3.1
omniauth-oauth2 1.4.0
omniauth-facebook 4.0.0
rails 5.0.0.1