learning-layers / timeliner

MIT License
0 stars 0 forks source link

Deal with expiration of user images #64

Open pjotrsavitski opened 8 years ago

pjotrsavitski commented 8 years ago

screen shot 2016-09-14 at 12 39 20 screen shot 2016-09-14 at 12 39 34

The current issue is with Facebook profile image on CDN that expires after some time (most probably along with the token).

StackOverflow thread: http://stackoverflow.com/questions/34580136/facebook-app-login-how-to-control-expiration-date-of-an-image-url-i-got

The sane solution seems to be to fetch the user image and serve that locally (should probably work well enough). Later on user would be able to pick and upload any suitable image instead.

Another one would be to deal with problematic images, replacing those with some default ones. This explains how it could be achieved: http://stackoverflow.com/questions/92720/jquery-javascript-to-replace-broken-images Using some kind of special replacement image that would clearly send a signal of what happend might be a good idea.

In case of Facebook, a new CDN image could be requested (provided that needed data is available).

pjotrsavitski commented 8 years ago

One more possibility is to store user images locally when user logs in through the social network. This way image will be served by our own endpoint (with permission checks applied).

This is probably the way to go. Later on user will be able to upload some other profile image if required.