Skip to content

Commit

Permalink
References #64, added a temporary fix.
Browse files Browse the repository at this point in the history
This is a nasty one and should be replaced by something better (store
images locally).
  • Loading branch information
pjotrsavitski committed Mar 13, 2017
1 parent fece3f3 commit 712d592
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ let userSchema = new Schema({
{
toJSON : {
transform: function (doc, ret) {
// This is a temporary solution to expired FB images
if ( ret.image && ret.social && ret.social[0].provider === 'facebook' ) {
ret.image = 'https://graph.facebook.com/v2.8/' + ret.social[0].provider.id + '/picture?redirect=true';
}
delete ret.__v;
delete ret.password;
delete ret.isActivated;
Expand Down

0 comments on commit 712d592

Please sign in to comment.