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