send APIKey (_id)
This commit is contained in:
parent
fc7d437f2e
commit
051100170c
|
@ -12,7 +12,6 @@ var TrackSchema = new mongoose.Schema({
|
||||||
numEvents: {type: Number, default: 0},
|
numEvents: {type: Number, default: 0},
|
||||||
comments: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Comment' }],
|
comments: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Comment' }],
|
||||||
author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
|
author: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
|
||||||
//Date;Time;Latitude;Longitude;Course;Speed;Right;Left;Confirmed;insidePrivacyArea
|
|
||||||
trackData: { type: mongoose.Schema.Types.ObjectId, ref: 'TrackData' },
|
trackData: { type: mongoose.Schema.Types.ObjectId, ref: 'TrackData' },
|
||||||
}, {timestamps: true});
|
}, {timestamps: true});
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@ UserSchema.methods.toAuthJSON = function(){
|
||||||
email: this.email,
|
email: this.email,
|
||||||
token: this.generateJWT(),
|
token: this.generateJWT(),
|
||||||
bio: this.bio,
|
bio: this.bio,
|
||||||
image: this.image
|
image: this.image,
|
||||||
|
apiKey: this._id
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue