private User createUser(Account account) { return new User( account.getEmail(), account.getPassword(), Collections.singleton(createAuthority(account))); }
private GrantedAuthority createAuthority(Account account) { return new SimpleGrantedAuthority(account.getRole()); }
@Transactional public Account save(Account account) { account.setPassword(passwordEncoder.encode(account.getPassword())); accountRepository.save(account); return account; }