예제 #1
0
 public void changePassword(String password) {
   User currentUser = userRepository.findOneByLogin(SecurityUtils.getCurrentLogin());
   String encryptedPassword = passwordEncoder.encode(password);
   currentUser.setPassword(encryptedPassword);
   userRepository.save(currentUser);
   log.debug("Changed password for User: {}", currentUser);
 }
예제 #2
0
 public void updateUserInformation(
     String firstName, String lastName, String email, String langKey) {
   User currentUser = userRepository.findOneByLogin(SecurityUtils.getCurrentLogin());
   currentUser.setFirstName(firstName);
   currentUser.setLastName(lastName);
   currentUser.setEmail(email);
   currentUser.setLangKey(langKey);
   userRepository.save(currentUser);
   log.debug("Changed Information for User: {}", currentUser);
 }
예제 #3
0
 @Transactional(readOnly = true)
 public User getUserWithAuthorities() {
   User currentUser = userRepository.findOneByLogin(SecurityUtils.getCurrentLogin());
   currentUser.getAuthorities().size(); // eagerly load the association
   return currentUser;
 }