File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,11 +105,13 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
105105 $ this ->session ->setCustomerData ($ customer );
106106 $ this ->session ->setCustomerGroupId ($ customer ->getGroupId ());
107107
108- // Added next lines to revoke token on each request if user token is still exist
108+ // Added next lines to update token on each request if user token is still exist
109109 $ tokenCollection = $ this ->tokenModelCollectionFactory ->create ()->addFilterByCustomerId ($ currentUserId );
110110
111111 if ($ tokenCollection ->getSize () > 0 ) {
112- $ this ->customerTokenService ->revokeCustomerAccessToken ($ currentUserId );
112+ $ tokenItems = $ tokenCollection ->getitems ();
113+ // get last token of current user and update its create date since magento expires it depending on it
114+ end ($ tokenItems )->setData ('created_at ' , date ("Y-m-d h:i:s " ))->save ();
113115 }
114116 }
115117
You can’t perform that action at this time.
0 commit comments