package net.davidvoid.thor.lightning.config;

import net.davidvoid.thor.lightning.service.security.JwtAuthenticationFilter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;


@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private JwtAuthenticationFilter filter = null;
    
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/users/*/login").permitAll().antMatchers("/users/*/logout").permitAll()
                .anyRequest().authenticated()
                .and().addFilterBefore(filter, UsernamePasswordAuthenticationFilter.class);
    }
    
}
@@ -463,16 +463,88 @@
 apter;%0D%0A
+import org.springframework.security.config.http.SessionCreationPolicy;%0D%0A
 import o
@@ -629,16 +629,16 @@
 ilter;%0D%0A
-
 %0D%0A%0D%0A@Ena
@@ -880,16 +880,157 @@
 tion %7B%0D%0A
+        http.logout().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);%0D%0A        http.csrf().disable();%0D%0A
         
@@ -1203,16 +1203,17 @@
 icated()
+;
 %0D%0A      
@@ -1218,22 +1218,12 @@
     
-        .and()
+http
 .add

disable csrf and made it stateless