Question

There are questions about getting the profile image from Twitter, Facebook or Google, but it would be nice if there were a simple and extensible wrapper that returned the profile image regardless of the current user's account service.

Était-ce utile?

La solution 2

In the meantime there is an Atmosphere package that returns the user profile picture and works for a lot of auth services:

bengott:avatar

Autres conseils

I think you would want to set the users profile picture yourself. Because the services do not have a standard way to store profile picture. And the meteor oauth has no required code for each service class to implement.

You could set it on account creation. This would require writing code for each service.

Accounts.onCreateUser(function (options, user) {


    if (user.services.google !== undefined) {

        user.profile.profile_picture = user.services.google.picture;

    }
  if (user.services.twitter !== undefined) {

        user.twitter.profile_picture = user.services.twitter.profile_url; // sudo param name

    }
    return user;
})

or on publish.

Instead of bengott:avatar (which is now deprecated), use the utilities:avatar package instead

You might also want to look at the accounts-meld package.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top