Browse Source

Replace PasswordEncoderFactories with BCryptPasswordEncoder

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
9fb7a98d32
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java

+ 2
- 1
bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java View File

@ -14,6 +14,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.thymeleaf.templateresolver.UrlTemplateResolver;
@ -78,7 +79,7 @@ public class BookstoreApplication extends SpringBootServletInitializer {
return (args) -> {
PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
commonLogger.info("Add new roles to the database");
Role adminAR = new Role(env.getProperty("auth.authority.admin"));


Loading…
Cancel
Save