Skip to content

Commit

Permalink
Merge pull request #2134 from spryker/bugfix/2133-LIVE09-Bruteforcing…
Browse files Browse the repository at this point in the history
…-user-names-in-Zed

2133: LIVE09 Bruteforcing of user name is fixed.
  • Loading branch information
hhebbo committed Jun 8, 2016
2 parents 14d2881 + f362f77 commit fcd79e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/Spryker/Zed/Customer/Business/Customer/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ public function confirmRegistration(CustomerTransfer $customerTransfer)
/**
* @param \Generated\Shared\Transfer\CustomerTransfer $customerTransfer
*
* @throws \Spryker\Zed\Customer\Business\Exception\CustomerNotFoundException
* @throws \Propel\Runtime\Exception\PropelException
*
* @return \Generated\Shared\Transfer\CustomerResponseTransfer
Expand All @@ -271,13 +270,6 @@ public function sendPasswordRestoreMail(CustomerTransfer $customerTransfer)
try {
$customerEntity = $this->getCustomer($customerTransfer);
} catch (CustomerNotFoundException $e) {
$customerError = new CustomerErrorTransfer();
$customerError->setMessage(Messages::CUSTOMER_EMAIL_INVALID);

$customerResponseTransfer
->setIsSuccess(false)
->addError($customerError);

return $customerResponseTransfer;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CustomerFacadeTest extends Test
{

const TESTER_EMAIL = 'tester@spryker.com';
const TESTER_NON_EXISTING_EMAIL = 'nonexisting@spryker.com';
const TESTER_PASSWORD = 'tester';
const TESTER_NAME = 'Tester';
const TESTER_CITY = 'Testcity';
Expand Down Expand Up @@ -245,6 +246,18 @@ public function testRestorePassword()
$this->assertTrue($customerResponseTransfer->getIsSuccess());
}

/**
* @return void
*/
public function testRestorePasswordNonExistent()
{
$customerTransfer = new CustomerTransfer();
$customerTransfer->setEmail(self::TESTER_NON_EXISTING_EMAIL);

$customerResponseTransfer = $this->customerFacade->sendPasswordRestoreMail($customerTransfer);
$this->assertTrue($customerResponseTransfer->getIsSuccess());
}

/**
* @return void
*/
Expand Down

0 comments on commit fcd79e8

Please sign in to comment.