Skip to content

Commit c76bbe6

Browse files
Merge pull request #1 from sagar2009kumar/sagar2009kumar-graphql-generateCustomerToken
Fixed the not expiry of token in generateCustomerToken graphql
2 parents 9b8d557 + c1290c5 commit c76bbe6

File tree

1 file changed

+5
-2
lines changed
  • app/code/Magento/Integration/Model/ResourceModel/Oauth/Token

1 file changed

+5
-2
lines changed

app/code/Magento/Integration/Model/ResourceModel/Oauth/Token/RequestLog.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ protected function _construct()
5858
*/
5959
public function getFailuresCount($userName, $userType)
6060
{
61+
$date = (new \DateTime())->setTimestamp($this->dateTime->gmtTimestamp());
62+
$dateTime = $date->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT);
63+
6164
$select = $this->getConnection()->select();
6265
$select->from($this->getMainTable(), 'failures_count')
63-
->where('user_name = :user_name AND user_type = :user_type');
66+
->where('user_name = :user_name AND user_type = :user_type AND lock_expires_at > :expiration_time');
6467

65-
return (int)$this->getConnection()->fetchOne($select, ['user_name' => $userName, 'user_type' => $userType]);
68+
return (int)$this->getConnection()->fetchOne($select, ['user_name' => $userName, 'user_type' => $userType, 'expiration_time' => $dateTime]);
6669
}
6770

6871
/**

0 commit comments

Comments
 (0)