Skip to content

Commit

Permalink
ENGCOM-2424: Reduce lengthy code of LoginPost #16928
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Idolov authored Jul 23, 2018
2 parents 3295a24 + 2baeb0e commit 81d92c1
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/code/Magento/Customer/Controller/Account/LoginPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,27 +171,24 @@ public function execute()
'This account is not confirmed. <a href="%1">Click here</a> to resend confirmation email.',
$value
);
$this->messageManager->addError($message);
$this->session->setUsername($login['username']);
} catch (UserLockedException $e) {
$message = __(
'You did not sign in correctly or your account is temporarily disabled.'
);
$this->messageManager->addError($message);
$this->session->setUsername($login['username']);
} catch (AuthenticationException $e) {
$message = __('You did not sign in correctly or your account is temporarily disabled.');
$this->messageManager->addError($message);
$this->session->setUsername($login['username']);
} catch (LocalizedException $e) {
$message = $e->getMessage();
$this->messageManager->addError($message);
$this->session->setUsername($login['username']);
} catch (\Exception $e) {
// PA DSS violation: throwing or logging an exception here can disclose customer password
$this->messageManager->addError(
__('An unspecified error occurred. Please contact us for assistance.')
);
} finally {
if (isset($message)) {
$this->messageManager->addError($message);
$this->session->setUsername($login['username']);
}
}
} else {
$this->messageManager->addError(__('A login and a password are required.'));
Expand Down

0 comments on commit 81d92c1

Please sign in to comment.