diff --git a/generators/spring-boot/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs b/generators/spring-boot/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs index 9c8c94892876..f2306f69dc7d 100644 --- a/generators/spring-boot/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs +++ b/generators/spring-boot/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs @@ -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) {