[{"userId":1,"id":1,"title":"sunt aut facere repellat provident occaecati excepturi optio reprehenderit", ...
@Controller
@RequestMapping("/index")
public class MainController {
@GetMapping
public String homePage(@AuthenticationPrincipal User user, Model model){
if(user != null){
model.addAttribute("user", user.getUsername());
return "/index";
} else {
model.addAttribute("user", "Аноним");
return "/index";
}
}