gwendall:accounts-helpers

v0.1.3Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

This package provides helpful helpers to deal with users.

Installation

meteor add gwendall:accounts-helpers

Server methods

Accounts.onJoin(cb({ user: ..., provider: ... })): On user joins for the first time [1]. Accounts.disconnect(userId, provider): Disconnect a social account.

[1]: onJoin does not trigger when Accounts.createUser is called with no client/user intent.

Client methods

Accounts.onLogin(cb): Hook for user log in.
Accounts.onLogout(cb): Hook for user log out.
Accounts.onConnect(cb(provider)): Hook for user connecting a social account when already logged in.
Accounts.onDisconnect(cb(provider)): Hook for user disconnecting a social account when already logged in.
Accounts.disconnect(provider, cb): Disconnect a social account.

Client template helpers

Login with {{provider}}: Logs in the user with a given provider.
Disconnect {{provider}}: Removed the given provider's credentials from the user.
Log out: Logs the user out.