source: src/main/java/edu/gjoko/schedlr/controllers/LoginController.java@ 763289e

Last change on this file since 763289e was 763289e, checked in by Gjoko <goko_kostadinov@…>, 20 months ago

Fix security

  • Property mode set to 100644
File size: 732 bytes
Line 
1package edu.gjoko.schedlr.controllers;
2
3import edu.gjoko.schedlr.entity.Stakeholder;
4import org.springframework.stereotype.Controller;
5import org.springframework.ui.Model;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.ModelAttribute;
8import org.springframework.web.bind.annotation.PostMapping;
9
10@Controller
11public class LoginController {
12
13 @GetMapping(path = "/login")
14 public String getMapping(Model model) {
15 model.addAttribute("stakeholder", new Stakeholder());
16 return "login";
17 }
18
19 @PostMapping(path = "/login")
20 public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) {
21 return "redirect:homepage";
22 }
23}
Note: See TracBrowser for help on using the repository browser.