]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-169: Password reset now takes token and password as form data rather than query...
authorremillet <remillet@yahoo.com>
Fri, 15 Dec 2017 17:12:58 +0000 (09:12 -0800)
committerremillet <remillet@yahoo.com>
Fri, 15 Dec 2017 17:12:58 +0000 (09:12 -0800)
services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java

index be998abd9ce6990f00ebd7c41ba984f70cc5f67f..8aaf5677ec72cf3e0abdec4102b30667272c135f 100644 (file)
@@ -67,6 +67,7 @@ import java.util.List;
 
 import javax.ws.rs.Consumes;
 import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
@@ -233,7 +234,10 @@ public class AccountResource extends SecurityResourceBase {
      */
     @POST
     @Path(PROCESS_PASSWORD_RESET_PATH)
-    synchronized public Response processPasswordReset(@Context UriInfo ui) throws UnsupportedEncodingException, DocumentNotFoundException {
+    @Consumes("application/x-www-form-urlencoded")
+    synchronized public Response processPasswordReset(@Context UriInfo ui, 
+               @FormParam("token") String tokenId,
+               @FormParam("password") String base64EncodedPassword) throws UnsupportedEncodingException, DocumentNotFoundException {
        Response response = null;
 
        //
@@ -245,14 +249,12 @@ public class AccountResource extends SecurityResourceBase {
         //
         // Get the 'token' and 'password' params
         //
-        String tokenId = queryParams.getFirst(AccountClient.PASSWORD_RESET_TOKEN_QP);
         if (tokenId == null || tokenId.trim().isEmpty()) {
                response = Response.status(Response.Status.BAD_REQUEST).entity(
                                "The query parameter 'token' is missing or contains no value.").type("text/plain").build();
                return response;
         }
 
-        String base64EncodedPassword = queryParams.getFirst(AccountClient.PASSWORD_RESET_PASSWORD_QP);
         if (base64EncodedPassword == null || base64EncodedPassword.trim().isEmpty()) {
                response = Response.status(Response.Status.BAD_REQUEST).entity(
                                "The query parameter 'password' is missing or contains no value.").type("text/plain").build();