File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
app/code/Magento/AdobeIms Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ public function execute(int $adminUserId = null): ?string
5555 {
5656 try {
5757 $ adminUserId = $ adminUserId ?? (int ) $ this ->userContext ->getUserId ();
58- return $ this ->userProfileRepository ->getByUserId ($ adminUserId )->getAccessToken ();
58+ return $ this ->encryptor ->decrypt (
59+ $ this ->userProfileRepository ->getByUserId ($ adminUserId )->getAccessToken ()
60+ );
5961 } catch (NoSuchEntityException $ exception ) {
6062 return null ;
6163 }
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ public function testExecute(?string $token): void
7272 ->willReturn ($ userProfileMock );
7373 $ userProfileMock ->expects ($ this ->once ())->method ('getAccessToken ' )->willReturn ($ token );
7474
75+ $ decryptedToken = $ token ?? '' ;
76+
77+ $ this ->encryptor ->expects ($ this ->once ())
78+ ->method ('decrypt ' )
79+ ->with ($ token )
80+ ->willReturn ($ decryptedToken );
81+
7582 $ this ->assertEquals ($ token , $ this ->getAccessToken ->execute ());
7683 }
7784
You can’t perform that action at this time.
0 commit comments