Skip to content

Commit

Permalink
respond with a generic message instead of 'That account does not exist'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Campanario committed Mar 12, 2024
1 parent c1fa7ea commit d50316a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Controller/Traits/PasswordManagementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,20 @@ public function requestResetPassword()
'type' => 'password',
]);
if ($resetUser) {
$msg = __d('cake_d_c/users', 'Please check your email to continue with password reset process');
$msg = __d('cake_d_c/users', 'If the account is valid, the system will send an instructional email to the address on record.');
$this->Flash->success($msg);
} else {
$msg = __d('cake_d_c/users', 'The password token could not be generated. Please try again');
$msg = __d('cake_d_c/users', 'There was an error please contact Administrator');
$this->Flash->error($msg);
}

return $this->redirect(['action' => 'login']);
} catch (UserNotFoundException $exception) {
$this->Flash->error(__d('cake_d_c/users', 'User {0} was not found', $reference));
} catch (UserNotActiveException $exception) {
$this->Flash->error(__d('cake_d_c/users', 'The user is not active'));
} catch (UserNotFoundException|UserNotActiveException $exception) {
$msg = __d('cake_d_c/users', 'If the account is valid, the system will send an instructional email to the address on record.');
$this->Flash->error($msg);
} catch (Exception $exception) {
$this->Flash->error(__d('cake_d_c/users', 'Token could not be reset'));
$msg = __d('cake_d_c/users', 'There was an error please contact Administrator');
$this->Flash->error($msg);
$this->log($exception->getMessage());
}
}
Expand Down

0 comments on commit d50316a

Please sign in to comment.