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.
Asked
Active
Viewed 3,252 times
6
-
1Maybe you should implement this as a [meteorite](https://atmosphere.meteor.com/) package and make it available for others to use :) – Andrew Mao Sep 18 '13 at 19:56
3 Answers
3
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.

adrianj98
- 584
- 2
- 9
3
In the meantime there is an Atmosphere package that returns the user profile picture and works for a lot of auth services:
bengott:avatar

Dan Dascalescu
- 143,271
- 52
- 317
- 404
0
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.

Samudra
- 1,013
- 1
- 14
- 21