Rails OmniAuth-Facebook并没有从FB收到电子邮件

时间:2015-12-27 18:16:44

标签: ruby-on-rails facebook-graph-api devise omniauth omniauth-facebook

我有一个使用Devise管理用户的rails应用程序,现在我添加了OmniAuth来授权Facebook登录,这就是问题,facebook没有回复电子邮件。

以下是数据:

package com.ap;

import static org.junit.Assert.assertTrue;
import org.junit.Test;

    public class RegularExpressionTest {

    private static RegularExpression re = new RegularExpression();

    @Test
    public void correctInput1() {
        boolean result = re.check("abABCD#-");  
        assertTrue(result);     
    }

    @Test
    public void correctInput2() {
        boolean result = re.check("bABCD#-a");  
        assertTrue(result);     
    }

    @Test
    public void correctInput3() {
        boolean result = re.check("bABCD#-a");  
        assertTrue(result);     
    }

    @Test
    public void correctInput4() {
        boolean result = re.check("ABCD#-ab");  
        assertTrue(result);     
    }

    @Test
    public void correctInput5() {
        boolean result = re.check("CD#-abAB");  
        assertTrue(result);     
    }

    @Test
    public void correctInput6() {
        boolean result = re.check("#aABb-CD");  
        assertTrue(result);     
    }

    @Test
    public void correctInput7() {
        boolean result = re.check("-A#bDaBC");  
        assertTrue(result);     
    }

    @Test
    public void incorrectInput1() {
        boolean result = re.check("abABC#-");   //total 7 character
        assertTrue(result);     
    }
    @Test
    public void incorrectInput2() {
        boolean result = re.check("abABCDE#-"); //total 9 character
        assertTrue(result);     
    }

    @Test
    public void incorrectInput3() {
        boolean result = re.check("abABCDE#");  // "-" symbol absent 
        assertTrue(result);     
    }

    @Test
    public void incorrectInput4() {
        boolean result = re.check("abABCDEFG"); // Symbol absent
        assertTrue(result);     
    }

    @Test
    public void incorrectInput5() {
        boolean result = re.check("ABCDEEF#-"); //lower case letter absent
        assertTrue(result);     
    }

    @Test
    public void incorrectInput6() {
        boolean result = re.check("abcdef#-");  // Upper case letter absent
        assertTrue(result);     
    }

    @Test
    public void incorrectInput7() {
        boolean result = re.check("abcABCf#-");//4 Uppercase & 2 lowercase character
        assertTrue(result);     
    }


}

在devise.rb上我的初始化者是我如何向Facebok API索取数据:

               Rails 4.2.4
               ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
               Devise 2.4.8
               Omniauth-Facebook 2.4.8
               Facebook API 2.5

但FB只向我发送用户名和用户个人资料图片,但不是电子邮件。

我已经访问过这个StackOverflow链接:

Facebook OAuth is not returning email in user info

Omniauth Facebook not returning email and gender rails 4

Ruby on Rails Omniauth facebook doesn't return email

{{3}}

0 个答案:

没有答案