diff --git a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java index 9bb20fd..94e79c6 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/RequestController.java @@ -29,16 +29,9 @@ public class RequestController { } @PostMapping("/login") - public String loginPost(HttpServletResponse response, @RequestParam(value = "goto", required = false) String gto) { + public String loginPost(HttpServletResponse response) { response.addCookie(new Cookie("login", "true")); - - System.out.println(gto); - - if (gto != null && gto.startsWith("/")) { - return "redirect:" + gto; - } else { - return "redirect:/"; - } + return "redirect:/"; } @PostMapping("/logout") @@ -82,12 +75,8 @@ public class RequestController { } @PostMapping("/shop/articles/{id}") - public String shopArticlesByIdBuy(@RequestAttribute("customer") Boolean isCustomer, @PathVariable("id") Integer id) { - if (isCustomer) { - return "redirect:/shop/checkout"; - } else { - return "redirect:/login?goto=%2Fshop%2Farticles%2F"+id; - } + public String shopArticlesByIdBuy(HttpServletResponse response) { + return "redirect:/shop/checkout"; } @GetMapping("/user/") diff --git a/prototype/src/main/resources/templates/shop/checkout.html b/prototype/src/main/resources/templates/shop/checkout.html index 6327d18..d35a220 100644 --- a/prototype/src/main/resources/templates/shop/checkout.html +++ b/prototype/src/main/resources/templates/shop/checkout.html @@ -30,8 +30,8 @@