diff --git a/src/main/java/com/example/daemawiki/domain/user/api/UserController.java b/src/main/java/com/example/daemawiki/domain/user/api/UserController.java index 67b94ecd..a1772e1e 100644 --- a/src/main/java/com/example/daemawiki/domain/user/api/UserController.java +++ b/src/main/java/com/example/daemawiki/domain/user/api/UserController.java @@ -36,9 +36,15 @@ public Mono profileUpload(@RequestPart(value = "file", required = true) Fi @PatchMapping("/password") @ResponseStatus(HttpStatus.NO_CONTENT) - public Mono changePassword(@Valid @RequestBody ChangePasswordRequest request) { + public Mono changePasswordCurrentUser(@Valid @RequestBody ChangePasswordRequest request) { return changePasswordService.currentUser(request); } + + @PatchMapping() + @ResponseStatus(HttpStatus.NO_CONTENT) + public Mono changePasswordNonLoggedInUser (@Valid @RequestBody ChangePasswordRequest request) { + return changePasswordService.nonLoggedInUser(request); + } @GetMapping("/gen") public Flux getUserByGen(@NotNull @RequestParam Integer param) { diff --git a/src/main/java/com/example/daemawiki/domain/user/service/ChangePassword.java b/src/main/java/com/example/daemawiki/domain/user/service/ChangePassword.java index 6f850967..ff541501 100644 --- a/src/main/java/com/example/daemawiki/domain/user/service/ChangePassword.java +++ b/src/main/java/com/example/daemawiki/domain/user/service/ChangePassword.java @@ -30,7 +30,7 @@ public Mono currentUser(ChangePasswordRequest request) { .flatMap(user -> changePasswordAndSaveUser(request.newPassword(), user)); } - public Mono NonLoggedInUser(ChangePasswordRequest request) { + public Mono nonLoggedInUser(ChangePasswordRequest request) { return userFacade.findByEmailNotNull(request.email()) .flatMap(user -> authMailRepository.findByMail(request.email()) .flatMap(verified -> {