Skip to content

Commit

Permalink
Merge branch 'sw-26909/adjust-customer-module-data' into 'v5.7.15'
Browse files Browse the repository at this point in the history
SW-26909 - adjust customer module

See merge request shopware/5/product/shopware!913
  • Loading branch information
mitelg committed Sep 8, 2022
2 parents 5b45d02 + af5cdbc commit fef1e05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/Shopware/Controllers/Backend/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,9 @@ private function getCustomer(int $id): array
$data['lastLogin'] = new DateTime('@0');
}

unset($data['sessionId']);
unset($data['hashPassword']);

return $data;
}

Expand Down
17 changes: 17 additions & 0 deletions tests/Functional/Controllers/Backend/CustomerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ public function setUp(): void
Shopware()->Plugins()->Backend()->Auth()->setNoAcl();
}

public function testSensitiveDataIsNotSend(): void
{
$customer = $this->createDummyCustomer();

$params = [
'customerID' => $customer->getId(),
];
$this->Request()->setMethod('POST')->setPost($params);
$this->dispatch('/backend/Customer/getDetail');

$body = $this->View()->getAssign();
static::assertTrue($body['success']);
static::assertArrayNotHasKey('hashPassword', $body['data']);
static::assertArrayNotHasKey('sessionId', $body['data']);
static::assertEquals('test@phpunit.org', $body['data']['email']);
}

/**
* Test saveAction controller action - change payment mean
*
Expand Down

0 comments on commit fef1e05

Please sign in to comment.