refactor: Fix some code smells #26
@ -1,7 +1,5 @@
|
||||
package de.szut.lf8_starter.welcome;
|
||||
|
||||
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
@ -19,8 +17,8 @@ public class WelcomeController {
|
||||
}
|
||||
|
||||
@GetMapping("/roles")
|
||||
public ResponseEntity getRoles(Authentication authentication) {
|
||||
return ResponseEntity.ok(authentication.getAuthorities());
|
||||
public ResponseEntity<Collection<GrantedAuthority>> getRoles(Authentication authentication) {
|
||||
return ResponseEntity.ok((Collection<GrantedAuthority>) authentication.getAuthorities());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user