I am using Drupal Services along with the JSON Services module as a data source.
I am using the DrupalCloud library, https://github.com/skyred/DrupalCloud/wiki, and am wondering how to best process the results that I receive from a userLogin() call.
If the call itself fails we get:
{
"#error": true,
"#message": "Some message"
}
If the call succeeds but the login credentials are wrong:
{
"#error": false,
"#data": {
"#error": true,
"#message": "Some message"
}
}
If the call success and the login credentials are correct, it returns:
{
"#error": false,
"#data": {
"sessid": "foo",
"user": {
"uid": "69",
"name": "Russell Jones",
"pass": "bar",
"mail": "russell@test.net",
"roles": {
"2": "authenticated user",
"5": "Student"
},
}
}
}
How do I go about using this data meaningfully? Or rather, how do I test to see if the call worked, and if the login was successful or not.