diff --git a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java index e92caf0..9989da0 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/AccountsRest.java @@ -104,6 +104,11 @@ throw new WebApplicationException(response.build()); } + if(!accountManager.getAccount(accountId).getPassword().equals(oldPassword)) { + var response = Response.status(Response.Status.BAD_REQUEST).entity("パスワードが違います");//404 + throw new WebApplicationException(response.build()); + } + //成功 if(accountManager.checkToken(accountId, token)) { accountManager.changeAccountId(accountId, newAccountId,oldPassword, token); @@ -126,6 +131,10 @@ @FormParam("new_password")String newPassword, @FormParam("old_password")String oldPassword, @FormParam("token") String token){ + if(!accountManager.getAccount(accountId).equals(oldPassword)) { + var response = Response.status(Response.Status.BAD_REQUEST).entity("パスワードが違います");//404 + throw new WebApplicationException(response.build()); + } if(accountManager.checkToken(accountId, token)) { accountManager.changePassword(accountId, newPassword, oldPassword, token); return;