signalpoint / jDrupal

A JavaScript Library and API for Drupal Applications
http://jdrupal.tylerfrankenstein.com/
GNU General Public License v2.0
76 stars 38 forks source link

Login - dont work #41

Closed pure4Sk closed 8 years ago

pure4Sk commented 8 years ago

I have project in Cordova. I can get nodes just fine, but login dont work. This core:

    // Connect to Drupal.
    jDrupal.connect().then(function() {

        jDrupal.userLogin('TestUser', '123456').then(function() {

          var user = jDrupal.currentUser();

          alert("user "+jDrupal.currentUser().id());

          console.log(JSON.stringify(user));

            jDrupal.nodeLoad(146).then(function(node) {
                alert(node.getTitle());

              console.log(JSON.stringify(node));

            });

        });

    });

returns this:

{"entity":{"uid":[{"value":0}],"roles":[{"target_id":"anonymous"}]}}

pure4Sk commented 8 years ago

Whole code: http://paste.ofcode.org/3bradkCYgkLhJcMwzcf8t9k

pure4Sk commented 8 years ago

Solved..seems it needs to be in app folder and Get needs to be set to json too