Skip to content

Commit edd0f8b

Browse files
committed
Undo removal of try-catch-block
1 parent 92858d1 commit edd0f8b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Security/Provider/MapbenderLdapBindAuthenticationProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ protected function checkAuthentication(UserInterface $user, UsernamePasswordToke
4848
try {
4949
parent::checkAuthentication($user, $token);
5050
} catch (BadCredentialsException $e) {
51-
throw new BadCredentialsException('The presented password is invalid: ' . $e->getMessage());
51+
try {
52+
if (!$this->encoderFactory->getEncoder($user)->isPasswordValid($user->getPassword(), $password, $user->getSalt())) {
53+
throw new BadCredentialsException('The presented password is invalid.');
54+
}
55+
} catch (\Exception $e){
56+
throw new BadCredentialsException('The presented password is invalid.');
57+
}
5258
}
5359
}
5460
}

0 commit comments

Comments
 (0)