Define a constant for a literal string that is duplicated n times (Sonar) (#978)

Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
This commit is contained in:
pixeebot[bot]
2024-03-28 17:44:10 +00:00
committed by GitHub
parent c16db14cd9
commit 1035a3be31
3 changed files with 16 additions and 10 deletions

View File

@@ -97,7 +97,7 @@ public class UserController {
// Logout using Spring's utility
new SecurityContextLogoutHandler().logout(request, response, null);
return new RedirectView("/login?messageType=credsUpdated");
return new RedirectView(LOGIN_MESSAGETYPE_CREDSUPDATED);
}
@PreAuthorize("!hasAuthority('ROLE_DEMO_USER')")
@@ -130,7 +130,7 @@ public class UserController {
// Logout using Spring's utility
new SecurityContextLogoutHandler().logout(request, response, null);
return new RedirectView("/login?messageType=credsUpdated");
return new RedirectView(LOGIN_MESSAGETYPE_CREDSUPDATED);
}
@PreAuthorize("!hasAuthority('ROLE_DEMO_USER')")
@@ -163,7 +163,7 @@ public class UserController {
// Logout using Spring's utility
new SecurityContextLogoutHandler().logout(request, response, null);
return new RedirectView("/login?messageType=credsUpdated");
return new RedirectView(LOGIN_MESSAGETYPE_CREDSUPDATED);
}
@PreAuthorize("!hasAuthority('ROLE_DEMO_USER')")
@@ -291,4 +291,6 @@ public class UserController {
}
return ResponseEntity.ok(apiKey);
}
private static final String LOGIN_MESSAGETYPE_CREDSUPDATED = "/login?messageType=credsUpdated";
}