javascript - Meteor: How can I get useraccounts package to write a new user doc into a remote collection? -
i'm using packages accounts-password
, useraccounts:bootstrap
, works fine, meaning sign-on form creates new doc in meteor.users collection. don't want collection on client facing app, hence have second app running connect via ddp.connect() , can exchange necessary docs/collections via pub/sub , calling methods on remote app.
the thing doesn't work useraccount doc. i've used (on client app):
remote.subscribe('users', meteor.userid(), function() { });
and (on remote app):
meteor.publish('users', function() { return meteor.users.find({}); });
even though i'm not sure if there pub/sub included in package. still, doc written local (client) app , not remote app.
how can achieve this?
useraccounts:core
makes use of accounts.createuser
on server side (see this line) within method called client-side (see this line). new user object created server side , not client (though flows way down client ddp , default users subscriptions...).
if you're looking change defaul behaviour provided meteor core accounts
packages (accounts-base
, accounts-password
in case...) should try override accounts.createuser
method begins...
in case warned current user published client default: see these lines
finally, prevent useraccounts:core
use accounts
api try override atcreateuserserver method , deal creation of new user on remote application inside there.
Comments
Post a Comment