diff --git a/src/main/java/de/bstly/board/controller/BaseController.java b/src/main/java/de/bstly/board/controller/BaseController.java index 17868bc..ed69071 100644 --- a/src/main/java/de/bstly/board/controller/BaseController.java +++ b/src/main/java/de/bstly/board/controller/BaseController.java @@ -55,26 +55,16 @@ public class BaseController { : null; } - /** - * Gets the local user. - * - * @return the local user - */ - protected LocalUser getLocalUser() { - return localUserManager.getByAuth(SecurityContextHolder.getContext().getAuthentication()); - } - /** * Gets the gravity. * * @return the gravity */ protected double getGravity() { - Authentication auth = SecurityContextHolder.getContext().getAuthentication(); - if (auth != null && auth.isAuthenticated()) { - LocalUser localUser = localUserManager.getByAuth(auth); - if (localUser != null && localUser.getSettings() != null - && localUser.getSettings().containsKey("gravity")) { + String username = getCurrentUsername(); + if (username != null) { + LocalUser localUser = localUserManager.getByUsername(username); + if (localUser.getSettings() != null && localUser.getSettings().containsKey("gravity")) { try { return Double.parseDouble(localUser.getSettings().get("gravity")); } catch (Exception e) {