Skip to content

Commit

Permalink
[FIX] 🐛 invalid user id
Browse files Browse the repository at this point in the history
  • Loading branch information
Donatien26 authored Mar 19, 2024
1 parent 40242a8 commit 5211b3b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public UserProvider getUserProvider() {
return auth -> {
final User user = new User();
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
user.setId(authentication.getPrincipal().toString());
user.setId(authentication.getName());
List<String> roles = authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.map(role -> role.replace("ROLE_", ""))
Expand Down

0 comments on commit 5211b3b

Please sign in to comment.