Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- // handler to login anonymously
- Accounts.registerLoginHandler(function(options) {
- if (!options.anonymous)
- return undefined; // don't handle
- // ok; if they are logging in, this means they don't have
- // a user yet. Create one. We don't need to ever find it again.
- var user = Accounts.insertUserDoc({generateLoginToken: true}, {}, {exists: true});
- return {token: user.token, id: user.id};
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement