Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeSung98 committed Nov 28, 2023
1 parent 71abe07 commit bf2bd10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public String googleLogin(){
return "redirect:/oauth2/authorization/google";
}

@PostMapping("/signup/email")
@PostMapping("/api/signup/email")
public ResponseEntity<JSONObject> verifyEmail(@RequestBody UserDTO userDTO) {
log.info("userDTO: " + userDTO);

Expand All @@ -37,7 +37,7 @@ public ResponseEntity<JSONObject> verifyEmail(@RequestBody UserDTO userDTO) {
return new ResponseEntity<>(result, HttpStatus.OK);
}

@PostMapping("/signup/nickname")
@PostMapping("/api/signup/nickname")
public ResponseEntity<JSONObject> verifyNickname(@RequestBody UserDTO userDTO) {
log.info("userDTO: " + userDTO);

Expand All @@ -49,7 +49,7 @@ public ResponseEntity<JSONObject> verifyNickname(@RequestBody UserDTO userDTO) {
return new ResponseEntity<>(result, HttpStatus.OK);
}

@PostMapping("/signup")
@PostMapping("/api/signup")
public ResponseEntity<JSONObject> signup(@RequestBody UserDTO userDTO) {
log.info("userDTO: " + userDTO);

Expand All @@ -62,7 +62,7 @@ public ResponseEntity<JSONObject> signup(@RequestBody UserDTO userDTO) {
}


@PostMapping("/profile")
@PostMapping("/api/profile")
public ResponseEntity<UserDTO> profile(@RequestBody UserDTO userDTO) {
log.info("userDTO: " + userDTO);

Expand All @@ -71,7 +71,7 @@ public ResponseEntity<UserDTO> profile(@RequestBody UserDTO userDTO) {
return new ResponseEntity<>(result, HttpStatus.OK);
}

@PatchMapping("/profile/modify")
@PatchMapping("/api/profile/modify")
public ResponseEntity<UserDTO> modify(@RequestBody UserDTO userDTO) {
log.info("userDTO: " + userDTO);

Expand All @@ -80,7 +80,7 @@ public ResponseEntity<UserDTO> modify(@RequestBody UserDTO userDTO) {
return new ResponseEntity<>(result, HttpStatus.OK);
}

@DeleteMapping("/profile/remove/{email}")
@DeleteMapping("/api/profile/remove/{email}")
public ResponseEntity remove(@PathVariable String email) {
log.info("email: " + email);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,23 @@ public void doFilterInternal(HttpServletRequest request, HttpServletResponse res
log.info("ApiCheckFilter..............................................");
log.info("ApiCheckFilter..............................................");

boolean checkHeader = checkAuthHeader(request);

if(checkHeader) {
filterChain.doFilter(request, response);
}
else {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
response.setContentType("application/json;charset=utf-8");
JSONObject json = new JSONObject();
String message = "FAIL CHECK API TOKEN";
json.put("code", "403");
json.put("message", message);

PrintWriter out = response.getWriter();
out.print(json);

}
return;
// boolean checkHeader = checkAuthHeader(request);
//
// if(checkHeader) {
// filterChain.doFilter(request, response);
// }
// else {
// response.setStatus(HttpServletResponse.SC_FORBIDDEN);
// response.setContentType("application/json;charset=utf-8");
// JSONObject json = new JSONObject();
// String message = "FAIL CHECK API TOKEN";
// json.put("code", "403");
// json.put("message", message);
//
// PrintWriter out = response.getWriter();
// out.print(json);
// }
// return;
}

log.info("?");
Expand Down

0 comments on commit bf2bd10

Please sign in to comment.