Skip to content

Commit 7eeef90

Browse files
ENGCOM-5987: #24716 #24769
- Merge Pull Request #24769 from ivan-koliadynskyy/magento2:admin-token-expire-time-24716 - Merged commits: 1. 218c164 2. c283bba 3. 0bda8d0 4. fc5ff12 5. 867925d
2 parents 3cbe632 + 867925d commit 7eeef90

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

app/code/Magento/Integration/Helper/Oauth/Data.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ public function getConsumerPostTimeout()
116116
/**
117117
* Get customer token lifetime from config.
118118
*
119-
* @return int hours
119+
* @return float hours
120120
*/
121121
public function getCustomerTokenLifetime()
122122
{
123-
$hours = (int)$this->_scopeConfig->getValue('oauth/access_token_lifetime/customer');
124-
return $hours > 0 ? $hours : 0;
123+
$hours = $this->_scopeConfig->getValue('oauth/access_token_lifetime/customer');
124+
return is_numeric($hours) && $hours > 0 ? $hours : 0;
125125
}
126126

127127
/**
128128
* Get customer token lifetime from config.
129129
*
130-
* @return int hours
130+
* @return float hours
131131
*/
132132
public function getAdminTokenLifetime()
133133
{
134-
$hours = (int)$this->_scopeConfig->getValue('oauth/access_token_lifetime/admin');
135-
return $hours > 0 ? $hours : 0;
134+
$hours = $this->_scopeConfig->getValue('oauth/access_token_lifetime/admin');
135+
return is_numeric($hours) && $hours > 0 ? $hours : 0;
136136
}
137137
}

app/code/Magento/Webapi/Model/Authorization/TokenUserContext.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function __construct(
9999
}
100100

101101
/**
102-
* {@inheritdoc}
102+
* @inheritdoc
103103
*/
104104
public function getUserId()
105105
{
@@ -108,7 +108,7 @@ public function getUserId()
108108
}
109109

110110
/**
111-
* {@inheritdoc}
111+
* @inheritdoc
112112
*/
113113
public function getUserType()
114114
{
@@ -187,6 +187,8 @@ protected function processRequest()
187187
}
188188

189189
/**
190+
* Set user data based on user type received from token data.
191+
*
190192
* @param Token $token
191193
* @return void
192194
*/

0 commit comments

Comments
 (0)