Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conventional login stopped working #107

Open
parth-vora-7 opened this issue Aug 11, 2017 · 0 comments
Open

Conventional login stopped working #107

parth-vora-7 opened this issue Aug 11, 2017 · 0 comments

Comments

@parth-vora-7
Copy link

Hello,

I'm successfully able to use this package for various social media providers. But the issue is that it stopped conventional login. I have troubleshot the issue and found that it is because of the common\models\User::findIdentity() method which gets used by both conventional as well as social media login:

For conventional login it should be like:

public static function findIdentity($userId) {
    return static::findOne(['user_id' => $userId, 'status' => self::STATUS_ACTIVE]);
}

whereas for social login it should be like:

public static function findIdentity($userId) {
    if (Yii::$app->getSession()->has('user-' . $userId)) {
        return new self(Yii::$app->getSession()->get('user-' . $userId));
     } else {
        return isset(self::$users[$userId]) ? new self(self::$users[$userId]) : null;
     }
}

So how can I make both working?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant