Commit 237ce7d9 by Patryk Czarnik

security - domyślna konfiguracja zapisana explicite

parent 4abcd26f
...@@ -2,6 +2,7 @@ package sklep.security; ...@@ -2,6 +2,7 @@ package sklep.security;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
...@@ -11,7 +12,8 @@ public class SecurityConfig { ...@@ -11,7 +12,8 @@ public class SecurityConfig {
@Bean @Bean
SecurityFilterChain configHttpSecurity(HttpSecurity httpSecurity) throws Exception { SecurityFilterChain configHttpSecurity(HttpSecurity httpSecurity) throws Exception {
httpSecurity httpSecurity
.authorizeHttpRequests(authz -> authz.anyRequest().permitAll()) .authorizeHttpRequests(authz -> authz.anyRequest().authenticated())
.formLogin(Customizer.withDefaults())
// .csrf(authz -> authz.disable()) // .csrf(authz -> authz.disable())
; ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment