package io.loli.box;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;

/**
 * @author choco
 */
@EnableWebMvcSecurity
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Value("${email}")
    private String email;
    @Value("${password}")
    private String password;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().antMatchers("/admin.html").hasRole("ADMIN").antMatchers("/image/**").permitAll()
                .and().formLogin()
                .permitAll().and().logout().permitAll().and().csrf().disable();
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication()
                .withUser(email).password(password).roles("ADMIN");
    }
}

@@ -459,16 +459,22 @@
 uration.
+Enable
 WebSecur
@@ -476,33 +476,16 @@
 Security
-ConfigurerAdapter
 ;%0Aimport
@@ -540,16 +540,8 @@
 web.
-servlet.
 conf
@@ -550,36 +550,44 @@
 uration.
-EnableWebMvcSecurity
+WebSecurityConfigurerAdapter
 ;%0A%0A/**%0A 
@@ -606,16 +606,16 @@
 oco%0A */%0A
+
 @EnableW
@@ -620,11 +620,8 @@
 eWeb
-Mvc
 Secu

Update import