diff --git a/api/components/OAuth2/Storage/SessionStorage.php b/api/components/OAuth2/Storage/SessionStorage.php index 8777f96..c056f9b 100644 --- a/api/components/OAuth2/Storage/SessionStorage.php +++ b/api/components/OAuth2/Storage/SessionStorage.php @@ -52,7 +52,7 @@ class SessionStorage extends AbstractStorage implements SessionInterface { ->andWhere([ 'client_id' => $clientId, 'owner_type' => $ownerType, - 'owner_id' => $ownerId, + 'owner_id' => (string)$ownerId, // Переводим в строку, чтобы работали индексы, т.к. поле varchar ])->scalar(); if ($sessionId === false) { diff --git a/console/migrations/m170415_195802_oauth_sessions_owner_id_index.php b/console/migrations/m170415_195802_oauth_sessions_owner_id_index.php new file mode 100644 index 0000000..08541e3 --- /dev/null +++ b/console/migrations/m170415_195802_oauth_sessions_owner_id_index.php @@ -0,0 +1,15 @@ +createIndex('owner_id', '{{%oauth_sessions}}', 'owner_id'); + } + + public function safeDown() { + $this->dropIndex('owner_id', '{{%oauth_sessions}}'); + } + +}