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