дефолтная страница логина
parent
8cb50f6762
commit
b21d3a6a5b
|
@ -9,16 +9,16 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
|
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
|
||||||
import ru.ldeloff.hedgehogcloud.service.UserService;
|
import ru.ldeloff.hedgehogcloud.service.UserServiceImpl;
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
UserService userService;
|
UserServiceImpl userService;
|
||||||
AuthenticationSuccessUserHandler authenticationSuccessUserHandler;
|
AuthenticationSuccessUserHandler authenticationSuccessUserHandler;
|
||||||
|
|
||||||
public WebSecurityConfig(UserService userService, AuthenticationSuccessUserHandler authenticationSuccessUserHandler) {
|
public WebSecurityConfig(UserServiceImpl userService, AuthenticationSuccessUserHandler authenticationSuccessUserHandler) {
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
this.authenticationSuccessUserHandler = authenticationSuccessUserHandler;
|
this.authenticationSuccessUserHandler = authenticationSuccessUserHandler;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
http.formLogin()
|
http.formLogin()
|
||||||
// указываем страницу с формой логина
|
// указываем страницу с формой логина
|
||||||
.loginPage("/login")
|
//.loginPage("/login")
|
||||||
//указываем логику обработки при логине
|
//указываем логику обработки при логине
|
||||||
.successHandler(authenticationSuccessUserHandler)
|
.successHandler(authenticationSuccessUserHandler)
|
||||||
// указываем action с формы логина
|
// указываем action с формы логина
|
||||||
|
|
Loading…
Reference in New Issue