From 9387ac6d694967333d36d9377152d1bd946068a2 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Thu, 11 Sep 2014 15:48:31 +0200 Subject: [PATCH] =?UTF-8?q?Opravena=20v=C3=BDjimka=20p=C5=99i=20vypr=C5=A1?= =?UTF-8?q?en=C3=AD=20session,=20nebo=20restartu=20serveru.=20M=C3=ADsto?= =?UTF-8?q?=20vyhozen=C3=AD=20v=C3=BDjimky=20se=20aplikace=20odhl=C3=A1s?= =?UTF-8?q?=C3=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info/bukova/isspst/services/users/UserServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java b/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java index e35dc814..925fe3cb 100644 --- a/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/users/UserServiceImpl.java @@ -18,6 +18,7 @@ import org.exolab.castor.xml.Unmarshaller; import org.hibernate.LazyInitializationException; import org.hibernate.Query; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.encoding.PasswordEncoder; @@ -98,6 +99,8 @@ public class UserServiceImpl extends AbstractService implements UserServic return (User)loadUserByUsername(((UserDetails)auth.getPrincipal()).getUsername()); } catch(UsernameNotFoundException e) { return null; + } catch (ClassCastException e) { + throw new AccessDeniedException("Timed out"); } }