package edu.gjoko.schedlr.controllers; import edu.gjoko.schedlr.entity.Stakeholder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import java.security.Principal; @Controller public class LoginController { @GetMapping(path = "/login") public String getMapping(@RequestParam(value = "error", required = false) String error, @ModelAttribute Stakeholder customer, Model model) { return "login"; } @PostMapping(path = "/login") public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) { return "redirect:homepage"; } }