You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A better way how to include belongsTo model in response #165
As I mentioned in the issue description, token.user is already defined by belongsTo User relationship, it's a function to get/set the related user model.
This is what I am looking for:
token.user(user);
// set a flag telling token.toJSON() to include
// the cached user in the response
I am closing this issue, since there was not enough people asking for this enhancement and it clearly was not a priority for us so far. We can reopen it again later when there is more demand.
Activity
raymondfeng commentedon Feb 12, 2014
You should be able to build the response as follows with loopback-datasource-juggler 1.3.x.
user.setStrict(false);
user.accessToken = ...;
bajtos commentedon Feb 12, 2014
Did you mean this?
As I mentioned in the issue description,
token.useris already defined bybelongsTo Userrelationship, it's a function to get/set the related user model.This is what I am looking for:
bajtos commentedon Feb 23, 2014
Related: #198
raymondfeng commentedon Feb 26, 2014
You should be able to do token.user(user) today. Can you try the following?
token.user(user);
token.setStrict(false); // If the statement above is not enough
bajtos commentedon Oct 22, 2014
I am closing this issue, since there was not enough people asking for this enhancement and it clearly was not a priority for us so far. We can reopen it again later when there is more demand.