Basic accounts

- add account link in welcome.html
- add AuthorizeExchangeSpec adminPaths in SecurityConfiguration
- add AccountController
- add users.html
- add getAccounts in AccountRegistryService
- add WebClient accountRegistryAccounts in webClient
This commit is contained in:
2025-01-23 14:02:59 +01:00
parent 3212226853
commit c40f1a0036
6 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<!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>Test</h1>
<hr>
<table>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr th:each="item : ${items}">
<td th:text="${item.id}">ID</td>
<td th:text="${item.timestamp}">timestamp</td>
<td th:text="${item.username}">username</td>
</tr>
</table>
<a th:href="@{/account(page=${page}+1, size=${size})}">Next</a>
<a th:href="@{/account(page=${page}-1, size=${size})}" th:unless="${page == 1}">Previous</a>
<br>
<a href="/logout">Logout</a>
</main>
<!--/*/<th:block th:replace="~{layout.html :: script}"/>/*/-->
</body>
</html>

View File

@@ -11,6 +11,7 @@
<!--/*@thymesVar id="remoteUser" type="ltd.hlaeja.security.RemoteAuthentication"*/-->
<div th:if="${remoteUser.hasRole('admin')}">
You are an admin!
<a href="/account">Account</a>
</div>
<div th:if="${remoteUser.hasRole('user')}">
You are a user!