我可以不使用Omniauth
取回电子邮件信息。
我认为问题在于API 2.4,
但我不知道我怎么能得到预期的信息
config.omniauth :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET'], {
:scope => 'email',
:info_fields => 'id,email,gender,link,locale,name,timezone,updated_time,verified',
strategy_class: OmniAuth::Strategies::Facebook,
:provider_ignores_state => true}
:1> env['omniauth.auth']
{
"provider" => "facebook",
"uid" => "xxxx",
"info" => {
"name" => "Eric Hsu",
"image" => "http://graph.facebook.com/xxxx/picture?type=square"
},
"credentials" => {
"token" => "CAAh",
"expires_at" => 1443066205,
"expires" => true
},
"extra" => {
"raw_info" => {
"name" => "Eric Hsu",
"id" => "xxxx"
}
}
}
答案 0 :(得分:0)
我发现问题是FB API和omniauth-facebook版本之间的依赖关系。
当前我安装了gem omniauth-facebook (2.0.1)