source: src/main/java/edu/gjoko/schedlr/controllers/LoginController.java@ 8bcd64c

Last change on this file since 8bcd64c was 8bcd64c, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 15 months ago

Add admin functionality and business admin functionality.

  • Property mode set to 100644
File size: 894 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;
9import org.springframework.web.bind.annotation.RequestParam;
10
11import java.security.Principal;
12
13@Controller
14public class LoginController {
15
16 @GetMapping(path = "/login")
17 public String getMapping(@RequestParam(value = "error", required = false) String error,
18 @ModelAttribute Stakeholder customer, Model model) {
19 return "login";
20 }
21
22 @PostMapping(path = "/login")
23 public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) {
24 return "redirect:homepage";
25 }
26}
Note: See TracBrowser for help on using the repository browser.