Fix condition when to store scopes from redis

This commit is contained in:
ErickSkrauch 2019-12-11 13:23:56 +03:00
parent 3c9050340e
commit cda4be04a1

View File

@ -26,7 +26,7 @@ class ManualMigrateController extends Controller {
/** @var OauthSession[] $sessions */ /** @var OauthSession[] $sessions */
$sessions = OauthSession::find()->andWhere(['legacy_id' => $sessionsIds]); $sessions = OauthSession::find()->andWhere(['legacy_id' => $sessionsIds]);
foreach ($sessions as $session) { foreach ($sessions as $session) {
if (!empty($session->scopes)) { if (empty($session->scopes)) {
$session->scopes = Yii::$app->redis->smembers("oauth:sessions:{$session->legacy_id}:scopes"); $session->scopes = Yii::$app->redis->smembers("oauth:sessions:{$session->legacy_id}:scopes");
Assert::true($session->save()); Assert::true($session->save());
} }