When attempting to register a new user, either programmatically, or through the included registration page, server returns a 500 error on the user/register.json.

Additionally, the registration page is only shown if I'm already logged in through the drupal side of things. Returns "Sorry, you are not authorized to view this page." when I navigate to onclick="javascript:drupalgap_goto('user/register');" when not logged in.

Here's my sample programmatic registration code:

      var account = {
        name:'sample',
        mail:'nonegiven@none.com'
//doesn't seem to matter if I include pass and/or pass2 in this array
      };
      user_register(account, {
        success:function(result) {
          console.log('registered user', result);
        },
        error:function(error) {
          console.log('registration error', error);
        }
      });

See the console log when viewing the site here: https://dev-cooking-matters.pantheonsite.io/mobile-application, click Log In at the bottom of the page to view the access denied error.

Hopefully someone else has experienced this and it's a simple fix?

Comments

mattshoaf created an issue. See original summary.

tyler.frankenstein’s picture

Status: Active » Closed (duplicate)

Sounds like you need to upgrade the Services module to the latest verision, and/or make sure anonymous users are allowed to register an account on your site, otherwise the app will throw an access denied error when trying to visit the registration page:

Duplicate issue(s): #2686047: user register problems adding fields

mattshoaf’s picture

I just started this project, didn't realize that the services module was out of date already!

FYI, now that I have that working, I noticed that the docs need updating: http://docs.drupalgap.org/7/Entities/Users
user_register() requires a password.

Thanks!