78.2 Find user (#9)

This commit is contained in:
Art
2021-09-09 22:54:47 +03:00
parent c1f3d53793
commit 0eedcf8269
2 changed files with 61 additions and 0 deletions

View File

@ -69,6 +69,11 @@ public class UserResource {
return userService.updateUser(currentUsername, userDto);
}
@GetMapping("{username}")
public User findUser(@PathVariable String username) {
return userService.findByUsername(username);
}
private void authenticate(String username, String password) {
Authentication auth = new UsernamePasswordAuthenticationToken(username, password);
authenticationManager.authenticate(auth);