login working
This commit is contained in:
parent
04c6247522
commit
1d5744c16e
@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||||||
public class MvcConfig implements WebMvcConfigurer {
|
public class MvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
public void addViewControllers(ViewControllerRegistry registry) {
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
registry.addViewController("/addCourse").setViewName("addCourse");
|
registry.addViewController("/courses").setViewName("addCourse");
|
||||||
registry.addViewController("/").setViewName("start");
|
registry.addViewController("/").setViewName("start");
|
||||||
registry.addViewController("/login").setViewName("login");
|
registry.addViewController("/login").setViewName("login");
|
||||||
registry.addViewController("/start").setViewName("start");
|
registry.addViewController("/start").setViewName("start");
|
||||||
|
@ -34,9 +34,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
protected void configure(HttpSecurity http) throws Exception {
|
||||||
http
|
http.authorizeRequests()
|
||||||
.authorizeRequests()
|
.antMatchers( "/", "/courses/**").authenticated()
|
||||||
.antMatchers( "/courses/**").authenticated()
|
|
||||||
.antMatchers("/", "/register").permitAll()
|
.antMatchers("/", "/register").permitAll()
|
||||||
.antMatchers("/", "/start").authenticated()
|
.antMatchers("/", "/start").authenticated()
|
||||||
//.anyRequest().authenticated()
|
//.anyRequest().authenticated()
|
||||||
|
@ -7,6 +7,7 @@ import org.imsglobal.lti.launch.LtiSigningException;
|
|||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
@ -40,6 +41,11 @@ public class StartController {
|
|||||||
return "start"; //view
|
return "start"; //view
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("")
|
||||||
|
public String start(){
|
||||||
|
return "start"; //view
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user