Update so there is an open landing page and a login page
- make / public - add login on index.html - add UserAttribute - add hasRole to RemoteAuthentication - update HomeController to give welcome instead of index if login. - add welcome.html
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<h1>Test</h1>
|
||||
<hr>
|
||||
<p>This is a index page!</p>
|
||||
<a href="/login">login</a>
|
||||
</main>
|
||||
<!--/*/<th:block th:replace="~{layout.html :: script}"/>/*/-->
|
||||
</body>
|
||||
|
||||
23
src/main/resources/templates/home/welcome.html
Normal file
23
src/main/resources/templates/home/welcome.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<title>Home Pages</title>
|
||||
<!--/*/<th:block th:insert="~{layout.html :: documentHead}"/>/*/-->
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Welcome</h1>
|
||||
<hr>
|
||||
<!--/*@thymesVar id="remoteUser" type="ltd.hlaeja.security.RemoteAuthentication"*/-->
|
||||
<div th:if="${remoteUser.hasRole('admin')}">
|
||||
You are an admin!
|
||||
</div>
|
||||
<div th:if="${remoteUser.hasRole('user')}">
|
||||
You are a user!
|
||||
</div>
|
||||
<p>This is welcome pages and you're a user!</p>
|
||||
<a href="/logout">Logout</a>
|
||||
</main>
|
||||
<!--/*/<th:block th:replace="~{layout.html :: script}"/>/*/-->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user