diff --git a/src/main/java/com/umc/commonplant/domain/Jwt/JwtService.java b/src/main/java/com/umc/commonplant/domain/Jwt/JwtService.java index d7f7c64..1e96f11 100644 --- a/src/main/java/com/umc/commonplant/domain/Jwt/JwtService.java +++ b/src/main/java/com/umc/commonplant/domain/Jwt/JwtService.java @@ -93,6 +93,7 @@ public boolean validateToken(String token){ log.info("Unsupported JWT token."); } catch (IllegalArgumentException e) { log.info("JWT token compact of handler are invalid."); + throw new BadRequestException(FAILED_TO_LOGIN_JWT); }catch (Exception e) { return false; } diff --git a/src/main/java/com/umc/commonplant/domain/oauth/controller/OAuthController.java b/src/main/java/com/umc/commonplant/domain/oauth/controller/OAuthController.java index ddabf06..4ea2098 100644 --- a/src/main/java/com/umc/commonplant/domain/oauth/controller/OAuthController.java +++ b/src/main/java/com/umc/commonplant/domain/oauth/controller/OAuthController.java @@ -37,8 +37,6 @@ public ResponseEntity validToken(){ String token = jwtService.getJwt(); boolean isValid = jwtService.validateToken(token); - return isValid ? - ResponseEntity.ok(new JsonResponse(true, 200, "유효한 토큰입니다", isValid)) - : ResponseEntity.ok(new JsonResponse(false, 2004, "토큰을 확인하세요", null)); + return ResponseEntity.ok(new JsonResponse(true, 200, "유효한 토큰입니다", isValid)); } } diff --git a/src/main/java/com/umc/commonplant/domain/user/controller/UserController.java b/src/main/java/com/umc/commonplant/domain/user/controller/UserController.java index 8ab1566..59e43c1 100644 --- a/src/main/java/com/umc/commonplant/domain/user/controller/UserController.java +++ b/src/main/java/com/umc/commonplant/domain/user/controller/UserController.java @@ -20,7 +20,7 @@ public class UserController implements UserSwagger{ private final JwtService jwtService; @PostMapping(value = "/user", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) //join - public ResponseEntity join(@RequestPart("user") UserDto.join req, @RequestPart(value ="image", required = false)MultipartFile image){ + public ResponseEntity join(@RequestPart("user") UserDto.join req, @RequestParam(value ="image", required = false)MultipartFile image){ log.info("join"); String token = userService.joinUser(req, image); diff --git a/src/main/java/com/umc/commonplant/domain/user/controller/UserSwagger.java b/src/main/java/com/umc/commonplant/domain/user/controller/UserSwagger.java index 8e4bddd..8690e3b 100644 --- a/src/main/java/com/umc/commonplant/domain/user/controller/UserSwagger.java +++ b/src/main/java/com/umc/commonplant/domain/user/controller/UserSwagger.java @@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; @@ -22,7 +23,7 @@ public ResponseEntity join( @Parameter( name = "image", description = "프로필 이미지" - )@RequestPart(value = "image", required = false)MultipartFile image + )@RequestParam(value = "image", required = false)MultipartFile image ); @Operation(summary = "유저 조회", description = "유저조회 API 호출") @Parameter(name = "name", description="조회할 유저 이름",example = "김커먼", required = true) diff --git a/src/main/java/com/umc/commonplant/domain/user/dto/UserDto.java b/src/main/java/com/umc/commonplant/domain/user/dto/UserDto.java index a1e1eaa..855ac5d 100644 --- a/src/main/java/com/umc/commonplant/domain/user/dto/UserDto.java +++ b/src/main/java/com/umc/commonplant/domain/user/dto/UserDto.java @@ -16,7 +16,7 @@ public class UserDto { @AllArgsConstructor @Data public static class join{ - @Schema(description = "회원가입할 사용자 email", example= "test@test.com") + @Schema(description = "회원가입할 사용자 email", example= "common@test.com") private String email; @Schema(description = "회원가입할 사용자 이름", example= "커먼") private String name;