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