Fix: problème d'authent
This commit is contained in:
parent
8a2ac5be69
commit
4a06b45020
@ -36,6 +36,7 @@ public class SpringSecurityConfig {
|
||||
.requestMatchers(HttpMethod.GET,
|
||||
"/api/authors",
|
||||
"/api/authors/{id}",
|
||||
"/api/authors/{id}/avatar",
|
||||
"/api/authors/{id}/posts",
|
||||
"/api/posts",
|
||||
"/api/posts/{id}",
|
||||
|
@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@ -76,7 +77,7 @@ public class AuthorController {
|
||||
@GetMapping("/{id}/avatar")
|
||||
public byte[] getProfilePicture(@PathVariable UUID id) {
|
||||
Author author = authorService.findById(id).orElseThrow(() -> new NotFoundException("Author not found"));
|
||||
return author.getProfilePicture();
|
||||
return Base64.getEncoder().encode(author.getProfilePicture());
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
|
Loading…
Reference in New Issue
Block a user