Skip to content

Commit

Permalink
Merge pull request #216 from cabinetoffice/release/11.2
Browse files Browse the repository at this point in the history
Release/11.2
  • Loading branch information
dylanwrightCO authored May 8, 2024
2 parents 2bdf588 + 4102abe commit 76fc8c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class OneLoginUserService {
@Value("${jwt.cookie-name}")
public String userServiceCookieName;

@Value("${jwt.cookie-domain}")
public String userServiceCookieDomain;

@Value("${admin-backend}")
private String adminBackend;

Expand Down Expand Up @@ -369,21 +372,10 @@ public void invalidateUserJwt(final Cookie customJWTCookie, final HttpServletRes
new Cookie(userServiceCookieName, null),
Boolean.TRUE,
Boolean.TRUE,
null
userServiceCookieDomain
);
userTokenCookie.setMaxAge(0);
response.addCookie(userTokenCookie);

final String authenticationCookieDomain = Objects.equals(this.configProperties.getProfile(), "LOCAL") ? "localhost" : "cabinetoffice.gov.uk";

final Cookie thirdPartyAuthToken = WebUtil.buildCookie(
new Cookie(authenticationProvider.getTokenCookie(), null),
Boolean.TRUE,
Boolean.TRUE,
authenticationCookieDomain
);
thirdPartyAuthToken.setMaxAge(0);
response.addCookie(thirdPartyAuthToken);
}

public void validateRoles(List<Role> userRoles, String payloadRoles) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Sorry, there is a problem with the service</h1>
<p class="govuk-body">
Try again later or return to the <a class="govuk-link" href="/login">login page</a>.
Try again later or return to the <a class="govuk-link" href="/apply/user/v2/login">login page</a>.
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/session-expired.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Sorry, your session has expired</h1>
<p class="govuk-body">
Return to the <a class="govuk-link" href="/login">login page</a> and try again.
Return to the <a class="govuk-link" href="/apply/user/v2/login">login page</a> and try again.
</p>
</div>
</div>
Expand Down

0 comments on commit 76fc8c1

Please sign in to comment.