Beispiel #1
0
 @Override
 public AccountDTO registerUser(RegistrationForm registrationForm) {
   if (null == registrationForm) {
     log.error("registrationForm was invalid, registration failed");
   } else {
     registrationForm.setPassword(EncodingUtils.encrypt(registrationForm.getPassword()));
     Account account = getMapper().map(registrationForm, Account.class);
     account.setAuthorities(new HashSet<>(Arrays.asList(Authority.AUTHOR)));
     return getMapper().map(accountRepository.save(account), AccountDTO.class);
   }
   return null;
 }
Beispiel #2
0
 @Override
 protected void configure(AuthenticationManagerBuilder auth) throws Exception {
   auth.userDetailsService(accountServiceImpl).passwordEncoder(EncodingUtils.passwordEncoder());
 }