Omniauth Facebook redirects to registration screen instead of creating user

落爺英雄遲暮 提交于 2019-12-01 21:01:42

Add this line to config/initializers/devise.rb

config.omniauth :facebook, "app id", "app secret", scope: 'email', info_fields: 'email'

There's a change in the new version of Facebook API, Introducing Graph API v2.4

Fewer default fields for faster performance: To help improve performance on mobile network connections, we've reduced the number of fields that the API returns by default. You should now use the ?fields=field1,field2 syntax to declare all the fields you want the API to return.

If you are following devise's wiki page then the authentication is failing. In tge controller if the authentication fails it redirects to the registration path. Just like mohamed said but you should now add first_name and last_name to your info_fields So in config/initializers/devise.rb write this config.omniauth :facebook, "app id", "app secret", scope: 'email', info_fields: 'email,first_name,last_name'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!