mirror of
https://github.com/gotson/komga.git
synced 2025-12-29 20:02:44 +01:00
refactor: incorrect exception thrown
This commit is contained in:
parent
ccc3d48441
commit
622f725896
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ class UserController(
|
|||
if (demo) throw ResponseStatusException(HttpStatus.FORBIDDEN)
|
||||
userRepository.findByEmailIgnoreCaseOrNull(principal.username)?.let { user ->
|
||||
userLifecycle.updatePassword(user, newPasswordDto.password, false)
|
||||
} ?: throw UsernameNotFoundException(principal.username)
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
|
|
@ -132,7 +132,7 @@ class UserController(
|
|||
if (demo) throw ResponseStatusException(HttpStatus.FORBIDDEN)
|
||||
userRepository.findByIdOrNull(id)?.let { user ->
|
||||
userLifecycle.updatePassword(user, newPasswordDto.password, user.id != principal.user.id)
|
||||
} ?: throw UsernameNotFoundException(principal.username)
|
||||
} ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
|
||||
}
|
||||
|
||||
@PatchMapping("{id}/shared-libraries")
|
||||
|
|
|
|||
Loading…
Reference in a new issue