Opravena výjimka při vypršení session, nebo restartu serveru. Místo
vyhození výjimky se aplikace odhlásí.
This commit is contained in:
@@ -18,6 +18,7 @@ import org.exolab.castor.xml.Unmarshaller;
|
|||||||
import org.hibernate.LazyInitializationException;
|
import org.hibernate.LazyInitializationException;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
||||||
@@ -98,6 +99,8 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
|
|||||||
return (User)loadUserByUsername(((UserDetails)auth.getPrincipal()).getUsername());
|
return (User)loadUserByUsername(((UserDetails)auth.getPrincipal()).getUsername());
|
||||||
} catch(UsernameNotFoundException e) {
|
} catch(UsernameNotFoundException e) {
|
||||||
return null;
|
return null;
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
throw new AccessDeniedException("Timed out");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user