Skip to content

Commit

Permalink
Role prefix removed
Browse files Browse the repository at this point in the history
  • Loading branch information
furknbulbul committed Dec 23, 2023
1 parent ad94bde commit f0a8ced
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public ResponseEntity<JwtResponse> signin(LoginUserRequest loginUserRequest) {
String jwt = jwtUtils.generateJwtToken(authentication);

UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();
List<String> roles = userDetails.getAuthorities().stream().map(item -> item.getAuthority())
.collect(Collectors.toList());
List<String> roles = userDetails.getAuthorities().stream().map(item -> item.getAuthority()).map(role -> role.split("_")[1]).collect(Collectors.toList());


return ResponseEntity
.ok(new JwtResponse(jwt, userDetails.getId(), userDetails.getName(), userDetails.getSurname(), userDetails.getEmail(), roles));
Expand Down

0 comments on commit f0a8ced

Please sign in to comment.