Skip to content

Commit 2218da0

Browse files
yukichikawadaapai4
authored andcommitted
When calling toAuthJSON method of the User model to return user data for editing Settings page, bio and image are empty which is inconsistent with angular2.realworld.io. Bio and imageUrl added to toAuthJSON method on User model. Node tutorial needs this, too. (#32)
1 parent f8ae17a commit 2218da0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/User.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ UserSchema.methods.toAuthJSON = function(){
4343
return {
4444
username: this.username,
4545
email: this.email,
46-
token: this.generateJWT()
46+
token: this.generateJWT(),
47+
bio: this.bio,
48+
image: this.image
4749
};
4850
};
4951

0 commit comments

Comments
 (0)