Skip to content

Commit 382c84c

Browse files
author
Stanislav Idolov
authored
ENGCOM-2066: [Forwardport] [BUGFIX] #15564 Generated admin API token expires immediately #15744
2 parents 31b92c9 + 9669bd6 commit 382c84c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ private function isTokenExpired(Token $token): bool
132132
// other user-type tokens are considered always valid
133133
return false;
134134
}
135+
136+
if (empty($tokenTtl)) {
137+
return false;
138+
}
139+
135140
if ($this->dateTime->strToTime($token->getCreatedAt()) < ($this->date->gmtTimestamp() - $tokenTtl * 3600)) {
136141
return true;
137142
}

0 commit comments

Comments
 (0)