feat: add About Me dialog showing user info, roles, and groups
All checks were successful
CI / cleanup-branch (push) Has been skipped
CI / build (push) Successful in 1m48s
CI / docker (push) Successful in 1m45s
CI / deploy-feature (push) Has been skipped
CI / deploy (push) Successful in 37s

- Add GET /api/v1/auth/me endpoint returning current user's UserDetail
- Add AboutMeDialog component with role badges and group memberships
- Add userMenuItems prop to TopBar via design-system update
- Wire "About Me" menu item into user dropdown above Logout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-08 12:12:29 +02:00
parent a8b977a2db
commit 448a63adc9
7 changed files with 213 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import com.cameleer3.server.core.admin.AuditResult;
import com.cameleer3.server.core.admin.AuditService;
import com.cameleer3.server.core.rbac.RbacService;
import com.cameleer3.server.core.rbac.SystemRole;
import com.cameleer3.server.core.rbac.UserDetail;
import com.cameleer3.server.core.security.JwtService;
import jakarta.servlet.http.HttpServletRequest;
import com.cameleer3.server.core.security.JwtService.JwtValidationResult;
@@ -22,6 +23,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -149,6 +152,21 @@ public class UiAuthController {
}
}
@GetMapping("/me")
@Operation(summary = "Get current user details")
@ApiResponse(responseCode = "200", description = "Current user details")
@ApiResponse(responseCode = "401", description = "Not authenticated")
public ResponseEntity<UserDetail> me(Authentication authentication) {
if (authentication == null || authentication.getName() == null) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Not authenticated");
}
UserDetail detail = rbacService.getUser(authentication.getName());
if (detail == null) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "User not found");
}
return ResponseEntity.ok(detail);
}
public record LoginRequest(String username, String password) {}
public record RefreshRequest(String refreshToken) {}
}