Skip to content

Commit

Permalink
store parent admin on jwt-create callback
Browse files Browse the repository at this point in the history
  • Loading branch information
danigargar committed Apr 10, 2024
1 parent 7e4d5f0 commit 6c57eb3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Operation/ExchangeToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ public function execute(string $inputToken, string $username): string
if (isset($parentAdminTokenPayload['onBehalfOf'])) {
$tokenChain[] = $parentAdminTokenPayload['onBehalfOf'];
}
$tokenChain[] = $parentAdminTokenPayload['iden'];

if (isset($parentAdminTokenPayload['onBehalfOfIds'])) {
$payload['onBehalfOfIds'] = $parentAdminTokenPayload['onBehalfOfIds'];
if (isset($parentAdminTokenPayload['onBehalfOfUsernames'])) {
$payload['onBehalfOfUsernames'] = $parentAdminTokenPayload['onBehalfOfUsernames'];
}
$payload['onBehalfOfIds'][] = $targetAdmin->getId();
$payload['onBehalfOfUsernames'][] = $parentAdminTokenPayload['username'];

$tokenChain[] = $parentAdminTokenPayload['iden'];
$payload['onBehalfOf'] = implode(' > ', $tokenChain);
$payload['iden'] = (string) $targetAdmin;

Expand Down

0 comments on commit 6c57eb3

Please sign in to comment.