julianlam / nodebb-plugin-sso-facebook

Single Sign-On Plugin for NodeBB
BSD 2-Clause "Simplified" License
19 stars 19 forks source link

download user profile picture from graph api #26

Open sarim opened 8 years ago

sarim commented 8 years ago

fixes #25

julianlam commented 8 years ago

While I have no specific objections toward saving the image to disk, can we not simply link to the image directly off Facebook's servers?

Also we might want to link this into image upload hooks... might be easier than saving to disk directly.

sarim commented 8 years ago

Actually I don't have previous experience with nodebb, so i may not be able to follow correct programming convention here.

In my experience, the image links from facebook aren't permanent. They expire/same link doesn't work for every user etc...

About image upload hooks, it seems like User.uploadFromUrl isn't implemented.

        if (!plugins.hasListeners('filter:uploadImage')) {
            return callback(new Error('[[error:no-plugin]]'));
        }

It depends on external plugins to implement it, right? So sso plugin need to have the code for downloading the picture, right?