Skip to content

Commit 5cceca6

Browse files
committed
final prob
1 parent b2c8201 commit 5cceca6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
NODE_ENV= 'dev'
33

44
# Connection string URI for your MongoDB database
5-
DATABASE='mongodb://ae38f3d8f1f51f8ba6d8b02610d6b391:neel12@6a.mongo.evennode.com:27017,6b.mongo.evennode.com:27017/ae38f3d8f1f51f8ba6d8b02610d6b391?replicaSet=eu-6'
5+
DATABASE=''
66

77
# Port that this app runs on
88
PORT='3000'

app/server/models/User.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,11 @@ schema.methods.checkPassword = function(password) {
243243

244244
// Token stuff
245245
schema.methods.generateEmailVerificationToken = function(){
246-
return jwt.sign(this.email, JWT_SECRET);
246+
return jwt.sign(this.email.toJSON(), JWT_SECRET);
247247
};
248248

249249
schema.methods.generateAuthToken = function(){
250-
return jwt.sign(this._id, JWT_SECRET);
250+
return jwt.sign(this._id.toJSON(), JWT_SECRET);
251251
};
252252

253253
/**
@@ -261,7 +261,7 @@ schema.methods.generateAuthToken = function(){
261261
*/
262262
schema.methods.generateTempAuthToken = function(){
263263
return jwt.sign({
264-
id: this._id
264+
id: this._id.toJSON()
265265
}, JWT_SECRET, {
266266
expiresInMinutes: 60,
267267
});

0 commit comments

Comments
 (0)