@POST
  @Path("{id}/password")
  @PermitAll
  public Response changePassword(@PathParam("id") Long userId, PasswordRequest request) {
    checkNotNull(userId);
    checkNotNull(request.getToken());
    checkPasswordFormat(request.getNewPassword());

    boolean isSuccess = userService.confirmResetPasswordUsingToken(userId, request.getNewPassword(), request.getToken());
    return isSuccess ? Response.noContent().build() : Response.status(Response.Status.BAD_REQUEST).build();
  }
@ POST @ Path ( "{id}/password" ) @ PermitAll public Response changePassword ( @ PathParam ( "id" ) Long userId , PasswordRequest request ) { checkNotNull ( userId ) ; checkNotNull ( request . getToken ( ) ) ; checkPasswordFormat ( request . getNewPassword ( ) ) ; boolean isSuccess = userService . confirmResetPasswordUsingToken ( userId , request . getNewPassword ( ) , request . getToken ( ) ) ; return isSuccess ? Response . noContent ( ) . build ( ) : Response . status ( Response . Status . BAD_REQUEST ) . build ( ) ; }
Change password using a temporary token.
Used during password reset flow.

@param userId unique user id
@param request newPassword and token
@return 204 if success, otherwise 403