I need to set Accounts.config individually for each user. So when client connects to server I need to set configs using data from User document.
Does anybody knows a better way? Method needs to be called so I thought that publication is better.
if (Meteor.isServer) {
Meteor.publish(null, function () {
if (this.userId) {
Accounts.config({
loginExpirationInDays: Meteor.users.findOne(this.userId).loginExpirationInDays
});
}
this.ready();
});
}