splendido / meteor-accounts-meld

Meteor package to meld user accounts registered with the same email address, or associate many different 3rd-party login services with the same user account.
http://test-accounts-meld.meteor.com/
98 stars 26 forks source link

How to show Add <social> Buttons to a template #5

Closed praneybehl closed 10 years ago

praneybehl commented 10 years ago

Hi Luca,

Thanks again for this amazing work in creating this package. I just had a look at https://github.com/splendido/test-accounts-meld and once signed-in I see Add Facebook, Google and so on buttons.

My question is how would it is possible to be able to add these button to some template lets say 'profile' or something?

It would be great to have a helper to be able to show those buttons where ever needed.

Thanks mate :)

splendido commented 10 years ago

The example uses accounts-templates-bootstrap and uses {{> signinForm}} which changes it face based on the AT internal state.

You should configure AccountsTemplates with showAddRemoveServices set to true and when the user is logged in and you call (e.g. with the onBeforeAction of the router for a specific page, lets say the user profile page...) AccountsTemplates.setState('sgin') that is what you achieve.

praneybehl commented 10 years ago

Thanks for the prompt reply. I'll give it a shot :+1:

splendido commented 10 years ago

Good!

Let me know what do you think about the presence of the logout button below the social ones.

Do you think it could be inappropriate for a profile page? Actually I don't see thee need for a sign out template which the only thing that has to do is calling Meteor.logout. It's been put there just to get some quick way to log out while testing. This king of discussion is also relevant for https://github.com/splendido/accounts-templates-core/issues/34

praneybehl commented 10 years ago

I don't really see a need for a logout button, as normally there is a logout button in the navbar.

splendido commented 10 years ago

:+1: