Domanda

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.

È stato utile?

Soluzione 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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top