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