Package eu.franzoni.domain

Examples of eu.franzoni.domain.User


    userRepository.save(new User("admin", "admin", "ROLE_ADMIN"));
  }
 
  @Override
  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    User user = userRepository.findByUsername(username);
    if(user == null) {
      throw new UsernameNotFoundException("user not found");
    }
    GrantedAuthority authority = new SimpleGrantedAuthority(user.getRole());
    return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), Collections.singleton(authority));
  }
View Full Code Here


  @Autowired
  private UserRepository userRepository;
 
  @PostConstruct 
  protected void initialize() {
    userRepository.save(new User("user", "demo", "ROLE_USER"));
    userRepository.save(new User("admin", "admin", "ROLE_ADMIN"));
  }
View Full Code Here

TOP

Related Classes of eu.franzoni.domain.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.