• Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.M8
    • 1.0.0.M8
    • examples
    • None

      Currently the user registration in the TODO app is not working. The reason for this is that there is a mismatch between the endpoint path that the client JS is using, 'enroll', and the path on the server side, 'register'.

      One option is to change client side and override the default path:
      client/src/main/webapp/js/app.js

       // Instantiate our authenticator
          var restAuth = AeroGear.Auth({
              name: "auth",
              settings: {
                  agAuth: true,
                  baseURL: "/todo-server/",
                  endpoints: {enroll: "auth/register"}
              }
          }).modules.auth;
      

      Another option would be to modify the server side @Path from 'register' to 'enroll':
      org.aerogear.todo.server.security.rest.AuthenticationEndpoint.java

      @POST
      @Path("/enroll")
      @Produces(MediaType.APPLICATION_JSON)
      public Response register(final AeroGearUser user) {
      
          //TODO it should be done by admin screen
          idm.grant(user.getRole()).to(user);
      
          return authenticationManager.login(user.getUsername(), user.getPassword());
      
      }
      

      The dev-list thread (see 'Forum Reference') will decide which change should be made. It was decided to change the resources path to 'enroll' in aerogear-security but in the TODO App let the client override this setting.

            [AEROGEAR-816] TODO App: Fix user registration

            New PR that overrides the enroll endpoint.

            Daniel Bevenius (Inactive) added a comment - New PR that overrides the enroll endpoint.

              dbeveniu Daniel Bevenius (Inactive)
              dbeveniu Daniel Bevenius (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: