Commit c411c606 by Patryk Czarnik

SecurityConfig - początek

parent bdc16fb8
...@@ -22,7 +22,7 @@ public class BasketConfiguration { ...@@ -22,7 +22,7 @@ public class BasketConfiguration {
return new HttpSessionListener() { return new HttpSessionListener() {
public void sessionCreated(HttpSessionEvent se) { public void sessionCreated(HttpSessionEvent se) {
HttpSession sesja = se.getSession(); HttpSession sesja = se.getSession();
sesja.setMaxInactiveInterval(30); // pół minuty i sesja wygasa // sesja.setMaxInactiveInterval(30); // pół minuty i sesja wygasa
System.out.println("sessionCreated " + sesja.getId()); System.out.println("sessionCreated " + sesja.getId());
Basket basket = new Basket(); Basket basket = new Basket();
sesja.setAttribute("basket", basket); sesja.setAttribute("basket", basket);
......
package sklep.security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
SecurityFilterChain configHttpSecurity(HttpSecurity httpSecurity) throws Exception {
return httpSecurity.build();
}
}
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