corrected password url

This commit is contained in:
Jottyfan 2023-10-07 11:12:21 +02:00
parent 5f6d71890e
commit 5f78b87a87
4 changed files with 16 additions and 2 deletions

View File

@ -8,7 +8,7 @@ plugins {
}
group = 'de.jottyfan.camporganizer'
version = '0.5.8'
version = '0.5.9'
description = """CampOrganizer2"""

View File

@ -75,6 +75,11 @@ public abstract class CommonController {
return keycloak.getUserClientUrl();
}
@ModelAttribute("keycloakPasswordUrl")
public String getKeycloakPasswordUrl() {
return keycloak.getPasswordClientUrl();
}
/**
* return true if the user has a valid keycloak session token
*

View File

@ -53,6 +53,15 @@ public class KeycloakRepository {
return String.format("%s/realms/%s/account/", url, keycloakRealm);
}
/**
* get the url of the user password client
*
* @return the url of the user password client
*/
public String getPasswordClientUrl() {
return String.format("%s%s", getUserClientUrl(), "#/security/signingin");
}
/**
* register the login in keycloak
*

View File

@ -136,7 +136,7 @@
</ul>
<ul class="dropdown-menu dropdown-menu-end" th:unless="${#strings.isEmpty(currentUser)}">
<li><a class="dropdown-item" th:href="@{${keycloakProfileUrl}}" target="_blank">Benutzername ändern</a></li>
<li><a class="dropdown-item" th:href="@{${keycloakProfileUrl} + '/password'}" target="_blank">Password ändern</a></li>
<li><a class="dropdown-item" th:href="@{${keycloakPasswordUrl}}" target="_blank">Password ändern</a></li>
<li><hr /></li>
<li><a class="dropdown-item" th:href="@{/logout}"><b th:inline="text">[[${currentUser}]]</b> ausloggen</a></li>
</ul>