문제

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.

도움이 되었습니까?

해결책 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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top