Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
eva-mueller-coremedia committed Sep 19, 2024
1 parent 0a20ea7 commit 89afbcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jenkinsci/plugins/oic/OicSecurityRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -1438,15 +1438,15 @@ public boolean handleTokenExpiration(HttpServletRequest httpRequest, HttpServlet
if (isUseRefreshTokens() && !Strings.isNullOrEmpty(credentials.getRefreshToken())) {
return refreshExpiredToken(user.getId(), credentials, httpRequest, httpResponse);
} else if (!isTokenExpirationCheckDisabled()) {
redirectOrRejectRequest(httpRequest, httpResponse);
redirectToLoginUrl(httpRequest, httpResponse);
return false;
}
}

return true;
}

private void redirectOrRejectRequest(HttpServletRequest req, HttpServletResponse res)
private void redirectToLoginUrl(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
if (req.getSession(false) != null || Strings.isNullOrEmpty(req.getHeader("Authorization"))) {
req.getSession().invalidate();
Expand Down Expand Up @@ -1564,7 +1564,7 @@ private void handleTokenRefreshException(
// RT expired or session terminated
if (!isTokenExpirationCheckDisabled()) {
try {
redirectOrRejectRequest(httpRequest, httpResponse);
redirectToLoginUrl(httpRequest, httpResponse);
} catch (ServletException ex) {
httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Token expired");

Check warning on line 1569 in src/main/java/org/jenkinsci/plugins/oic/OicSecurityRealm.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/jenkinsci/plugins/oic/OicSecurityRealm.java#L1568-L1569

Added lines #L1568 - L1569 were not covered by tests
}
Expand Down

0 comments on commit 89afbcf

Please sign in to comment.