source: src/main/java/com/example/salonbella/controller/login/LoginController.java@ 4d7e387

Last change on this file since 4d7e387 was 4d7e387, checked in by makyjovanovsky <mjovanovski04@…>, 18 months ago

commit 1

  • Property mode set to 100644
File size: 962 bytes
Line 
1package com.example.salonbella.controller.login;
2
3import org.springframework.stereotype.Controller;
4import org.springframework.ui.Model;
5import org.springframework.web.bind.annotation.GetMapping;
6import org.springframework.web.bind.annotation.RequestMapping;
7import org.springframework.web.bind.annotation.RequestParam;
8
9import java.util.Map;
10
11@Controller
12public class LoginController {
13
14
15 @GetMapping("/login")
16 public String getLoginPage(@RequestParam Map<String, String> allParams, Model model) {
17 for (String s : allParams.keySet()) {
18 if (s.equals("error")) {
19 model.addAttribute("message", "Invalid username/password");
20 return "login";
21 }
22 }
23 return "login";
24 }
25
26 @GetMapping("/userDashboard")
27 public String getUserPage() {
28 return "user-page";
29 }
30
31 @GetMapping("/adminDashboard")
32 public String getAdminPage() {
33 return "admin-page";
34 }
35}
Note: See TracBrowser for help on using the repository browser.