【发布时间】:2017-01-29 05:45:52
【问题描述】:
我正在学习http://www.yiiframework.com/wiki/459/integrating-hybridauth-directly-into-yii-without-an-extension/的教程
我包括了 twitter 登录,
问题是 twitter 没有返回电子邮件地址
Hybrid_User_Profile 对象([标识符] => 2378654169 [webSiteURL] => https://tisthedomainname.co/tpAnZH2BGe [profileURL] => http://twitter.com/myhjghj [photoURL] => http://pbs.twimg.com/profile_images/639065265478965088/8zty_o1K.png [displayName] => myhjghj [description] => 一些文字在这里 - https://tisthedomainname.co/0yuxRheYVD [firstName] => myhjghj [lastName] => [gender] => [语言] => [年龄] => [birthDay] => [birthMonth] => [birthYear] => [email] => [emailVerified] => [phone] => [address] => [country] => [地区] => 英国 [城市] => [zip] => )
在这个网址中https://dev.twitter.com/rest/reference/get/account/verify_credentials (并告诉我如何使用这个网址以及何时使用) 据说
“如果用户的账户中没有邮箱地址,或者邮箱地址未经验证,则返回null。”
对于 facebook 和 google,我使用电子邮件地址登录
public function login()
{
$this->username = $this->userProfile->email; //CUserIdentity
Yii::app()->user->login($this, 0);
}
如果用户在 Twitter 中没有电子邮件 ID,我该如何登录?
【问题讨论】: