78.3 List all users (#9)
This commit is contained in:
@ -16,6 +16,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
@ -74,6 +75,11 @@ public class UserResource {
|
||||
return userService.findByUsername(username);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public List<User> getAllUsers() {
|
||||
return userService.findAll();
|
||||
}
|
||||
|
||||
private void authenticate(String username, String password) {
|
||||
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
|
||||
authenticationManager.authenticate(auth);
|
||||
|
||||
Reference in New Issue
Block a user