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
55
55
{
56
56
try {
57
57
$ 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
+ );
59
61
} catch (NoSuchEntityException $ exception ) {
60
62
return null ;
61
63
}
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ public function testExecute(?string $token): void
72
72
->willReturn ($ userProfileMock );
73
73
$ userProfileMock ->expects ($ this ->once ())->method ('getAccessToken ' )->willReturn ($ token );
74
74
75
+ $ decryptedToken = $ token ?? '' ;
76
+
77
+ $ this ->encryptor ->expects ($ this ->once ())
78
+ ->method ('decrypt ' )
79
+ ->with ($ token )
80
+ ->willReturn ($ decryptedToken );
81
+
75
82
$ this ->assertEquals ($ token , $ this ->getAccessToken ->execute ());
76
83
}
77
84
You can’t perform that action at this time.
0 commit comments