mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Allow multiple calls to Accounts.config without overriding settings
This commit is contained in:
@@ -12,7 +12,14 @@ if (!Accounts._options) {
|
||||
// - forbidClientAccountCreation {Boolean}
|
||||
// Do not allow clients to create accounts directly.
|
||||
Accounts.config = function(options) {
|
||||
Accounts._options = options;
|
||||
_.each(["sendConfirmationEmail", "forbidClientAccountCreation"], function(key) {
|
||||
if (key in options) {
|
||||
if (key in Accounts._options)
|
||||
throw new Error("Can't set `" + key + "` more than once");
|
||||
else
|
||||
Accounts._options[key] = options[key];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Users table. Don't use the normal autopublish, since we want to hide
|
||||
|
||||
Reference in New Issue
Block a user