@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; }
@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(accountServiceImpl).passwordEncoder(EncodingUtils.passwordEncoder()); }