I would like catch the AccountExpiredException with fosUser while user login. Actually if user have an expired account he is redirect to login form. I would like change it and give him the possibility to connect. I have a login manager and i don't know where i can catch AccountExpiredException and change action.
EDIT :
I have found where i can change this action , it is in UserChecker class(security/core/user) , but i don't want directly write in this class. I can't find a way to override UserChecker and change checkPreAuth. Some help very appreciate , i'm lost.
EDIT :
i use symfony 2.7 , the only way (ugly way) i found is to commente $user->isAccountNonExpired() like this :
class UserChecker implements UserCheckerInterface
{
public function checkPreAuth(UserInterface $user)
{
if (!$user instanceof AdvancedUserInterface) {
return;
}
if (!$user->isAccountNonLocked()) {
$ex = new LockedException('User account is locked.');
$ex->setUser($user);
throw $ex;
}
if (!$user->isEnabled()) {
$ex = new DisabledException('User account is disabled.');
$ex->setUser($user);
throw $ex;
}
if (!$user->isAccountNonExpired()) {
/*$ex = new AccountExpiredException('User account has expired.');
$ex->setUser($user);
throw $ex;*/
}
}
i dont find the good methode to override checkPreAuth.