Authorization Header 추가에 대해 #145
-
의견현재 저희 서비스 특성 상 대부분의 기능이 로그인을 해야 이용가능한 서비스로 구성되어있습니다. 추가 작업 예상내용위 구조가 추가됨에 따라 각 트랙별로 발생할 것으로 예상되는 작업내용은 다음과 같습니다. 백엔드Member 정보를 요구하는 API 작성 시 Parameter에 // 예시
@PostMapping
public ResponseEntity<Void> create(
@RequestBody @Valid PetPlantRequest request,
@Auth Member member) {
PetPlantResponse petPlantResponse = petPlantService.create(request, member);
return ResponseEntity.created(URI.create("/pet-plants/" + petPlantResponse.getId())).build();
} 프론트Member 정보를 요구하는 API에 대해 요청을 보낼 때 Authorization 헤더에 사용자 인증정보(토큰)를 포함하여 보낸다. // 예시
fetch("http://api.pium.life/pet-plants",{
method : "POST",
headers : {
Authorization : "[email protected]"
}
})
.then(response => response.json())
.then(response => {
console.log(response.data);
}) 의견 재정리위 추가작업에 대한 내용을 현재 개발과정에서 적용하는 것이 어떤지 여러분의 의견이 궁금합니다. 위 작업으로 인해 예상되는 이점은 다음과 같습니다.
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 3 replies
-
좋아요 👍 |
Beta Was this translation helpful? Give feedback.
-
좋은 생각인 것 같아요! |
Beta Was this translation helpful? Give feedback.
-
안좋습니다! 폐기해주세요 |
Beta Was this translation helpful? Give feedback.
-
코드를 이렇게밖에 못짭니까??? |
Beta Was this translation helpful? Give feedback.
-
저도 동의합니다! 나중에 변경할 부분이 줄어들 것 같아요 |
Beta Was this translation helpful? Give feedback.
-
해당 내용 관련하여 백엔드 코드 적용 완료했습니다. |
Beta Was this translation helpful? Give feedback.
해당 내용 관련하여 백엔드 코드 적용 완료했습니다.