The issue is that if the user has already logged in and tried to log in again, then the associated record's user_id in the user_aouth table is set to 0. I guess the user_id is int and the code is trying to put the email address in Yii::app()->user->id there. Then again the Yii::app()->user->id should not have been an email address in the first place.
protected function getAccessCode()
{
$oAuth = $this->oAuth;
// If we already have a user logged in, associate the authenticated
// provider with the logged-in user
if(!Yii::app()->user->isGuest) {
$accessCode = 1;
$oAuth->bindTo(Yii::app()->user->id);
} else {
Yii::app()->user->id - this is id (primary key)
Yii::app()->user->email - this is email (CWebUser has no such property, therefore you should implement this by yourself)
Dear All
The issue is that if the user has already logged in and tried to log in again, then the associated record's user_id in the user_aouth table is set to 0. I guess the user_id is int and the code is trying to put the email address in Yii::app()->user->id there. Then again the Yii::app()->user->id should not have been an email address in the first place.
protected function getAccessCode() { $oAuth = $this->oAuth; // If we already have a user logged in, associate the authenticated // provider with the logged-in user if(!Yii::app()->user->isGuest) { $accessCode = 1; $oAuth->bindTo(Yii::app()->user->id); } else {