File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/web Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2525import org .springframework .web .bind .annotation .GetMapping ;
2626import org .springframework .web .bind .annotation .ModelAttribute ;
2727
28+ import static java .util .Collections .emptyMap ;
29+ import static java .util .Collections .singletonMap ;
30+
2831@ AdminController
2932public class UiController {
3033 private final String adminContextPath ;
@@ -48,8 +51,11 @@ public Map<String, Object> getUiSettings() {
4851 }
4952
5053 @ ModelAttribute (value = "user" , binding = false )
51- public Principal getUiSettings (Principal principal ) {
52- return principal ;
54+ public Map <String , Object > getUiSettings (Principal principal ) {
55+ if (principal != null ) {
56+ return singletonMap ("name" , principal .getName ());
57+ }
58+ return emptyMap ();
5359 }
5460
5561 @ GetMapping (path = "/" , produces = MediaType .TEXT_HTML_VALUE )
You can’t perform that action at this time.
0 commit comments