Landing now shows logout if logged in instead of create account

This commit is contained in:
neviyn 2021-06-15 15:34:58 +01:00
parent c6bd0e2ad9
commit 0865f51478

View File

@ -1,10 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"> <html lang="en" xmlns:sec="http://www.thymeleaf.org/extras/spring-security" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<meta th:replace="fragments :: header"/> <meta th:replace="fragments :: header"/>
<title>Booru</title> <title>Booru</title>
</head> </head>
<body> <body>
<form id="logoutForm" method="POST" th:action="@{/logout}" sec:authorize="isAuthenticated()">
<input name="${_csrf.parameterName}" type="hidden" value="${_csrf.token}"/>
</form>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@ -20,7 +23,8 @@
<span class="text-secondary"> |</span> <span class="text-secondary"> |</span>
<a class="text-decoration-none" th:href="${#mvc.url('MC#memberDetails').build()}">My Account</a> <a class="text-decoration-none" th:href="${#mvc.url('MC#memberDetails').build()}">My Account</a>
<span class="text-secondary"> |</span> <span class="text-secondary"> |</span>
<a class="text-decoration-none" th:href="${#mvc.url('BC#showRegister').build()}">Create Account</a> <a class="text-decoration-none" th:href="${#mvc.url('BC#showRegister').build()}" sec:authorize="!isAuthenticated()">Create Account</a>
<a class="text-decoration-none" sec:authorize="isAuthenticated()" onclick="document.forms['logoutForm'].submit()" style="cursor: pointer">Logout</a>
</p> </p>
</div> </div>
</div> </div>