send APIKey (_id)

This commit is contained in:
hpcwoess 2020-08-15 10:59:00 +02:00
parent fc7d437f2e
commit 051100170c
2 changed files with 2 additions and 2 deletions

View file

@ -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});

View file

@ -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
}; };
}; };