Skip to content

Commit d72429a

Browse files
committed
BAEL-9467 Update Spring Security article
-Removed redundant field
1 parent 8860029 commit d72429a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
@ComponentScan("org.baeldung.security")
2424
public class SecurityJavaConfig extends WebSecurityConfigurerAdapter {
2525

26-
@Autowired
27-
private PasswordEncoder encoder;
28-
2926
@Autowired
3027
private CustomAccessDeniedHandler accessDeniedHandler;
3128

@@ -45,9 +42,9 @@ public SecurityJavaConfig() {
4542
@Override
4643
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
4744
auth.inMemoryAuthentication()
48-
.withUser("admin").password(encoder.encode("adminPass")).roles("ADMIN")
45+
.withUser("admin").password(encoder().encode("adminPass")).roles("ADMIN")
4946
.and()
50-
.withUser("user").password(encoder.encode("userPass")).roles("USER");
47+
.withUser("user").password(encoder().encode("userPass")).roles("USER");
5148
}
5249

5350
@Override

0 commit comments

Comments
 (0)