This commit is contained in:
Parpaillax
2024-04-24 10:07:02 +02:00
parent 9dd6febff1
commit 07b47b3f41
5 changed files with 37 additions and 7 deletions

View File

@@ -39,6 +39,17 @@ public class ProfilController {
}
}
@GetMapping("/edit")
public String edit(Model model) {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (!authentication.getName().equals("anonymousUser")) {
String username = authentication.getName();
UserProfil userProfile = userService.utilisateurByName(username);
model.addAttribute("userProfile", userProfile);
}
return "editProfil";
}
@PostMapping("/edit")
public String editProfile(Model model) {
// Obtenez l'authentification actuelle