Skip to content

Commit

Permalink
Merge pull request #597 from bounswe/fix/be-596-remove-role-prefix
Browse files Browse the repository at this point in the history
Role prefix removed
  • Loading branch information
volcaniqueo authored Dec 23, 2023
2 parents ad94bde + f0a8ced commit 8ff756c
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 8ff756c

Please sign in to comment.