|
|
@@ -17,9 +17,12 @@ public class LoadFixedUser {
|
|
|
CommandLineRunner initDatabase(CustomUserRepository repository) {
|
|
|
return args -> {
|
|
|
CustomUser admin = new CustomUser("admin", "notAnAdmin");
|
|
|
- log.info("admin pwd " + admin.getPassword());
|
|
|
- log.info("Preloading " + repository.save(admin));
|
|
|
- log.info("Preloading " + repository.save(new CustomUser("clovis", "M1m2pBP.")));
|
|
|
+ if (repository.findByUsername("admin") == null) {
|
|
|
+ log.info("Preloading " + repository.save(admin));
|
|
|
+ }
|
|
|
+ if (repository.findByUsername("clovis") == null) {
|
|
|
+ log.info("Preloading " + repository.save(new CustomUser("clovis", "M1m2pBP.")));
|
|
|
+ }
|
|
|
};
|
|
|
}
|
|
|
}
|