Skip to content

Commit a955619

Browse files
authored
Fix API token lookup with OAuth token table (#38082)
* v22 standaloen * Fix postNewMessage() return type annotations * improvement
1 parent fb4e280 commit a955619

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

htdocs/api/class/api_access.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function __isAllowed()
150150
}
151151
} else {
152152
if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && defined("DOLENTITY")) {
153-
$sql = "SELECT u.login, u.datec, u.api_key as use_api, oat.tokenstring as api_key, oat.entity as token_entity, rowid as token_rowid,";
153+
$sql = "SELECT u.login, u.datec, u.api_key as use_api, oat.tokenstring as api_key, oat.entity as token_entity, oat.rowid as token_rowid,";
154154
$sql .= " oat.tms as date_modification,";
155155
$sql .= " gu.entity";
156156
$sql .= " FROM ".$this->db->prefix()."oauth_token AS oat";
@@ -161,7 +161,7 @@ public function __isAllowed()
161161
$sql .= " AND gu.entity = oat.entity";
162162
$sql .= " AND oat.service = 'dolibarr_rest_api'";
163163
} else {
164-
$sql = "SELECT u.login, u.datec, u.api_key as use_api, u.entity, oat.tokenstring as api_key, oat.entity as token_entity, rowid as token_rowid,";
164+
$sql = "SELECT u.login, u.datec, u.api_key as use_api, u.entity, oat.tokenstring as api_key, oat.entity as token_entity, oat.rowid as token_rowid,";
165165
$sql .= " oat.tms as date_modification";
166166
$sql .= " FROM ".$this->db->prefix()."oauth_token AS oat";
167167
$sql .= " JOIN ".$this->db->prefix()."user AS u ON u.rowid = oat.fk_user";

0 commit comments

Comments
 (0)