mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-01-14 20:11:17 +01:00
moar cleanup
This commit is contained in:
parent
d4ac6148d8
commit
dbd899dc99
@ -66,7 +66,6 @@ public class CustomLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
|
|||||||
if (!response.isCommitted()) {
|
if (!response.isCommitted()) {
|
||||||
if (authentication != null) {
|
if (authentication != null) {
|
||||||
if (authentication instanceof OAuth2AuthenticationToken oAuthToken) {
|
if (authentication instanceof OAuth2AuthenticationToken oAuthToken) {
|
||||||
log.info("OAuth2 logout via JWT - attempting OIDC logout");
|
|
||||||
getAuthRedirect(request, response, oAuthToken);
|
getAuthRedirect(request, response, oAuthToken);
|
||||||
} else if (authentication instanceof Saml2Authentication samlAuthentication) {
|
} else if (authentication instanceof Saml2Authentication samlAuthentication) {
|
||||||
getAuthRedirect(request, response, samlAuthentication);
|
getAuthRedirect(request, response, samlAuthentication);
|
||||||
@ -99,7 +98,6 @@ public class CustomLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Redirect for SAML2 authentication logout
|
// Redirect for SAML2 authentication logout
|
||||||
|
|
||||||
private void getAuthRedirect(
|
private void getAuthRedirect(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
@ -149,7 +147,6 @@ public class CustomLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Redirect for OAuth2 authentication logout
|
// Redirect for OAuth2 authentication logout
|
||||||
|
|
||||||
private void getAuthRedirect(
|
private void getAuthRedirect(
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
HttpServletResponse response,
|
HttpServletResponse response,
|
||||||
@ -176,7 +173,7 @@ public class CustomLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect for JWT-based OAuth2 authentication logout
|
// Redirect for JWT-based authentication logout
|
||||||
private void getAuthRedirect(HttpServletRequest request, HttpServletResponse response)
|
private void getAuthRedirect(HttpServletRequest request, HttpServletResponse response)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
OAUTH2 oauth = securityProperties.getOauth2();
|
OAUTH2 oauth = securityProperties.getOauth2();
|
||||||
|
|||||||
@ -51,7 +51,8 @@ class UserLicenseSettingsServiceTest {
|
|||||||
|
|
||||||
when(applicationProperties.getPremium()).thenReturn(premium);
|
when(applicationProperties.getPremium()).thenReturn(premium);
|
||||||
when(applicationProperties.getAutomaticallyGenerated()).thenReturn(automaticallyGenerated);
|
when(applicationProperties.getAutomaticallyGenerated()).thenReturn(automaticallyGenerated);
|
||||||
when(automaticallyGenerated.getIsNewServer()).thenReturn(false); // Default: not a new server
|
when(automaticallyGenerated.getIsNewServer())
|
||||||
|
.thenReturn(false); // Default: not a new server
|
||||||
when(settingsRepository.findSettings()).thenReturn(Optional.of(mockSettings));
|
when(settingsRepository.findSettings()).thenReturn(Optional.of(mockSettings));
|
||||||
when(userService.getTotalUsersCount()).thenReturn(80L);
|
when(userService.getTotalUsersCount()).thenReturn(80L);
|
||||||
when(settingsRepository.save(any(UserLicenseSettings.class)))
|
when(settingsRepository.save(any(UserLicenseSettings.class)))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user