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
RevLine 
[204464d]1package edu.gjoko.schedlr.controllers;
2
[763289e]3import edu.gjoko.schedlr.entity.Stakeholder;
[204464d]4import org.springframework.stereotype.Controller;
5import org.springframework.ui.Model;
6import org.springframework.web.bind.annotation.GetMapping;
[763289e]7import org.springframework.web.bind.annotation.ModelAttribute;
8import org.springframework.web.bind.annotation.PostMapping;
[8bcd64c]9import org.springframework.web.bind.annotation.RequestParam;
10
11import java.security.Principal;
[204464d]12
13@Controller
14public class LoginController {
15
[763289e]16 @GetMapping(path = "/login")
[8bcd64c]17 public String getMapping(@RequestParam(value = "error", required = false) String error,
18 @ModelAttribute Stakeholder customer, Model model) {
[204464d]19 return "login";
20 }
[763289e]21
22 @PostMapping(path = "/login")
23 public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) {
24 return "redirect:homepage";
25 }
[204464d]26}
Note: See TracBrowser for help on using the repository browser.