mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
correctly display error message when email is not found during password recovery
This commit is contained in:
@@ -235,7 +235,7 @@ public class UserREST {
|
|||||||
public ImmutableList<String> getErrors() {
|
public ImmutableList<String> getErrors() {
|
||||||
return ImmutableList.of(e.getMessage());
|
return ImmutableList.of(e.getMessage());
|
||||||
}
|
}
|
||||||
}).build();
|
}).type(MediaType.TEXT_PLAIN).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ public class UserREST {
|
|||||||
public Response sendPasswordReset(@Valid PasswordResetRequest req) {
|
public Response sendPasswordReset(@Valid PasswordResetRequest req) {
|
||||||
User user = userDAO.findByEmail(req.getEmail());
|
User user = userDAO.findByEmail(req.getEmail());
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
return Response.status(Status.PRECONDITION_FAILED).entity("Email not found.").build();
|
return Response.status(Status.PRECONDITION_FAILED).entity("Email not found.").type(MediaType.TEXT_PLAIN).build();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
user.setRecoverPasswordToken(DigestUtils.sha1Hex(UUID.randomUUID().toString()));
|
user.setRecoverPasswordToken(DigestUtils.sha1Hex(UUID.randomUUID().toString()));
|
||||||
|
|||||||
Reference in New Issue
Block a user