Skip to content

Commit 0bee9a1

Browse files
committed
refactor: move signin to controller
1 parent dccc0a0 commit 0bee9a1

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/main/java/de/rwth/idsg/steve/config/BeanConfiguration.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,6 @@ public void addResourceHandlers(final ResourceHandlerRegistry registry) {
205205
registry.addResourceHandler("/static/**").addResourceLocations("static/");
206206
}
207207

208-
@Override
209-
public void addViewControllers(ViewControllerRegistry registry) {
210-
registry.addViewController("/manager/signin").setViewName("signin");
211-
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
212-
}
213-
214208
// -------------------------------------------------------------------------
215209
// API config
216210
// -------------------------------------------------------------------------

src/main/java/de/rwth/idsg/steve/web/controller/SignOutController.java renamed to src/main/java/de/rwth/idsg/steve/web/controller/SignInOutController.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
2323
import org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices;
2424
import org.springframework.stereotype.Controller;
25+
import org.springframework.web.bind.annotation.GetMapping;
2526
import org.springframework.web.bind.annotation.RequestMapping;
26-
import org.springframework.web.bind.annotation.RequestMethod;
2727

2828
import jakarta.servlet.http.HttpServletRequest;
2929
import jakarta.servlet.http.HttpServletResponse;
@@ -34,9 +34,14 @@
3434
*/
3535
@Controller
3636
@RequestMapping(value = "/manager")
37-
public class SignOutController {
37+
public class SignInOutController {
3838

39-
@RequestMapping(value = "/signout", method = RequestMethod.GET)
39+
@GetMapping(value = "/signin")
40+
public String signIn() {
41+
return "signin";
42+
}
43+
44+
@GetMapping(value = "/signout")
4045
public String signOut(HttpServletRequest request, HttpServletResponse response) {
4146
new SecurityContextLogoutHandler()
4247
.logout(request, response, null);

0 commit comments

Comments
 (0)