Skip to content

Commit

Permalink
fix(sonar): simplify authentication response type
Browse files Browse the repository at this point in the history
  • Loading branch information
gantoin committed Oct 12, 2024
1 parent 059b93d commit 021df74
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ public class AuthenticateController {
<%_ } _%>

/**
* {@code GET /authenticate} : check if the user is authenticated, and return its login.
* {@code GET /authenticate} : check if the user is authenticated, and return a boolean value.
*
* @param principal the authentication principal.
* @return the login if the user is authenticated.
* @return a boolean indicating if the user is authenticated.
*/
@GetMapping(value = "/authenticate", produces = MediaType.TEXT_PLAIN_VALUE)
public String isAuthenticated(Principal principal) {
public boolean isAuthenticated(Principal principal) {
LOG.debug("REST request to check if the current user is authenticated");
return principal == null ? null : principal.getName();
return principal != null;
}

public String createToken(Authentication authentication, boolean rememberMe) {
Expand Down

0 comments on commit 021df74

Please sign in to comment.