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