Skip to content
9 changes: 3 additions & 6 deletions app/code/Magento/Customer/Controller/Account/Confirmation.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2015 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -99,10 +99,7 @@ public function execute()
);
$this->messageManager->addSuccessMessage(__('Please check your email for confirmation key.'));
return $this->getRedirect('*/*/index', ['_secure' => true]);
} catch (InvalidTransitionException $e) {
$this->messageManager->addSuccessMessage(__('This email does not require confirmation.'));
return $this->getRedirect('*/*/index', ['_secure' => true]);
} catch (NoSuchEntityException $e) {
} catch (InvalidTransitionException | NoSuchEntityException $e) {
$this->messageManager->addErrorMessage(__('Wrong email.'));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,13 @@ public function testActiveUserConfirmationAction()
);

$this->dispatch('customer/account/confirmation');
$this->assertRedirect($this->stringContains('customer/account/index'));
$this->assertSessionMessages(
$this->equalTo(
[
'This email does not require confirmation.',
'Wrong email.',
]
),
MessageInterface::TYPE_SUCCESS
MessageInterface::TYPE_ERROR
);
}

Expand Down