Skip to content

Commit

Permalink
AUT-2068 Correct label for tara auth logout button
Browse files Browse the repository at this point in the history
  • Loading branch information
Alvar195 committed Dec 19, 2024
1 parent cbd6a6d commit 80080d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ public ModelAndView dashboard(@AuthenticationPrincipal OidcUser oidcUser, Exampl
if (AccessTokenUtil.isJwtAccessToken(accessToken)) {
model.addObject("access_token", accessToken);
}
String locale = LogoutUtil.getUiLocale(request);
if (locale != null) {
model.addObject("ui_locales", locale);
}
}

log.info("Showing dashboard for subject='{}'", oidcUser.getSubject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ private String endpointUri(HttpServletRequest request, URI endSessionEndpoint, S

if (request.getMethod().equals(HttpMethod.GET.name())) {
builder.queryParam("id_token_hint", idToken);
if (StringUtils.isNotEmpty(locale)) {
builder.queryParam(UI_LOCALES_PARAMETER, locale);
}
}
if (StringUtils.isNotEmpty(locale)) {
builder.queryParam(UI_LOCALES_PARAMETER, locale);
}
if (postLogoutRedirectUri != null) {
builder.queryParam("post_logout_redirect_uri", postLogoutRedirectUri);
Expand Down
10 changes: 6 additions & 4 deletions src/main/resources/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
<ul class="navbar-nav navbar-expand px-3">
<li class="nav-item px-1 text-nowrap">
<form method="post" th:action="@{/oauth/logout}" id="logoutFormPost">
<input type="hidden" th:id="id_token_hint" name="id_token_hint" th:value="${id_token}">
<input th:if="${ui_locales}" type="hidden" th:id="ui_locales" name="ui_locales" th:value="${ui_locales}">
<input class="btn btn-outline-secondary" name="logout_button" type="submit" value="Log out (POST)"/>
<input th:if="${authentication_provider == 'govsso'}"
type="hidden" th:id="id_token_hint"
name="id_token_hint" th:value="${id_token}">
<input class="btn btn-outline-secondary" name="logout_button" type="submit"
th:value="${authentication_provider == 'govsso' ? 'Log out (POST)' : 'Log out'}"/>
</form>
</li>
<li class="nav-item px-1 text-nowrap">
<li class="nav-item px-1 text-nowrap" th:if="${authentication_provider == 'govsso'}">
<form method="get" th:action="@{/oauth/logout}" id="logoutFormGet">
<input class="btn btn-outline-secondary" name="logout_button" type="submit" value="Log out (GET)"/>
</form>
Expand Down

0 comments on commit 80080d9

Please sign in to comment.