File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Webapi/Model/Authorization Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -116,22 +116,22 @@ public function getConsumerPostTimeout()
116
116
/**
117
117
* Get customer token lifetime from config.
118
118
*
119
- * @return int hours
119
+ * @return string hours
120
120
*/
121
121
public function getCustomerTokenLifetime ()
122
122
{
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 ;
125
125
}
126
126
127
127
/**
128
128
* Get customer token lifetime from config.
129
129
*
130
- * @return int hours
130
+ * @return string hours
131
131
*/
132
132
public function getAdminTokenLifetime ()
133
133
{
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 ;
136
136
}
137
137
}
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ private function isTokenExpired(Token $token): bool
137
137
return false ;
138
138
}
139
139
140
- if ($ this ->dateTime -> strToTime ($ token ->getCreatedAt ()) < ($ this ->date ->gmtTimestamp () - $ tokenTtl * 3600 )) {
140
+ if ($ this ->date -> timestamp ($ token ->getCreatedAt ()) < ($ this ->date ->gmtTimestamp () - $ tokenTtl * 3600 )) {
141
141
return true ;
142
142
}
143
143
You can’t perform that action at this time.
0 commit comments