I am using Ionic2 with backendless REST API.
After successfull login, i receive an user object.
Object {lastLogin: 1463742055662, created: 1456890510000, name: "personal", ___class: "Users", user-token: "7652C01C-7343-F9AE-FF15-DD7E0427A800"…}
<ol>___class:"Users"
__meta:"{"relationRemovalIds":{},"selectedProperties":["__updated__meta","password","created","name","___class","ownerId","updated","objectId","email"],"relatedObjects":{}}"
created:1456890510000
email:"personal@gmail.com"
lastLogin:1463742055662
name:"personal"
objectId:"C8FE36A2-9396-13C5-FF9C-8F8EF7F07900"
ownerId:null
updated:null
user-token:"7652C01C-7343-F9AE-FF15-DD7E0427A800"
__proto__:Object
</ol>
my user_service.js
userLogin(userData)
{
let body = JSON.stringify({ login: userData.email, password: userData.password });
let headers = new Headers(this.Backend_Header);
let options = new RequestOptions({ headers: headers });
return this.http.post(this.Backend_Login_Url, body, options)
.map((res) => {
let data = res.json();
console.log('data.email at user_service', data.email); // result : personal@gmail.com
console.log('data.objectId at user_service', data.objectId); // result C8FE36A2-9396-13C5-FF9C-8F8EF7F07900
console.log('data.user-token at user_service', data.user-token); // result Reference error : Token is not defined
this.storage.set('userStorage', JSON.stringify(data)); // result : success
return data;
});
}
From my service.js, you can see that i can get the user objectId or email or name.
But i can not get the user token.
Thks in advance for ur kindly help.