Last change
on this file was 74af394, checked in by makyjovanovsky <mjovanovski04@…>, 20 months ago |
login/register with mail confirmation
|
-
Property mode
set to
100644
|
File size:
962 bytes
|
Line | |
---|
1 | package com.example.salonbella.controller.login;
|
---|
2 |
|
---|
3 | import org.springframework.stereotype.Controller;
|
---|
4 | import org.springframework.ui.Model;
|
---|
5 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
6 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
7 | import org.springframework.web.bind.annotation.RequestParam;
|
---|
8 |
|
---|
9 | import java.util.Map;
|
---|
10 |
|
---|
11 | @Controller
|
---|
12 | public 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.