From 1f43e53a83458223afb79887d95d3be19a981f49 Mon Sep 17 00:00:00 2001 From: neviyn Date: Fri, 30 Apr 2021 12:27:40 +0100 Subject: [PATCH] Added login page --- .../kotlin/uk/co/neviyn/booru/Controller.kt | 7 +++ src/main/resources/templates/login.html | 47 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/main/resources/templates/login.html diff --git a/src/main/kotlin/uk/co/neviyn/booru/Controller.kt b/src/main/kotlin/uk/co/neviyn/booru/Controller.kt index 28fc4c8..94f2114 100644 --- a/src/main/kotlin/uk/co/neviyn/booru/Controller.kt +++ b/src/main/kotlin/uk/co/neviyn/booru/Controller.kt @@ -27,6 +27,13 @@ class BaseController return "landing" } + @GetMapping("/login") + fun login(model: Model, error: String?, logout: String?): String? { + if (error != null) model.addAttribute("error", "Your username and password is invalid.") + if (logout != null) model.addAttribute("message", "You have been logged out successfully.") + return "login" + } + } @Controller diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html new file mode 100644 index 0000000..b8cbd86 --- /dev/null +++ b/src/main/resources/templates/login.html @@ -0,0 +1,47 @@ + + + + + Login + + + +
+
+
+

Welcome back

+
+
+
+
+ +
+
+
+
+ Home +
+
+
+ + \ No newline at end of file