Skip to content

Commit af5cdbc

Browse files
committed
SW-26909 - adjust customer module
1 parent cc87efc commit af5cdbc

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

engine/Shopware/Controllers/Backend/Customer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ private function getCustomer(int $id): array
791791
$data['lastLogin'] = new DateTime('@0');
792792
}
793793

794+
unset($data['sessionId']);
795+
unset($data['hashPassword']);
796+
794797
return $data;
795798
}
796799

tests/Functional/Controllers/Backend/CustomerTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ public function setUp(): void
6060
Shopware()->Plugins()->Backend()->Auth()->setNoAcl();
6161
}
6262

63+
public function testSensitiveDataIsNotSend(): void
64+
{
65+
$customer = $this->createDummyCustomer();
66+
67+
$params = [
68+
'customerID' => $customer->getId(),
69+
];
70+
$this->Request()->setMethod('POST')->setPost($params);
71+
$this->dispatch('/backend/Customer/getDetail');
72+
73+
$body = $this->View()->getAssign();
74+
static::assertTrue($body['success']);
75+
static::assertArrayNotHasKey('hashPassword', $body['data']);
76+
static::assertArrayNotHasKey('sessionId', $body['data']);
77+
static::assertEquals('[email protected]', $body['data']['email']);
78+
}
79+
6380
/**
6481
* Test saveAction controller action - change payment mean
6582
*

0 commit comments

Comments
 (0)