meteor-useraccounts / core

Meteor sign up and sign in templates' core functionalities
http://useraccounts.meteor.com/
MIT License
529 stars 278 forks source link

AccountsTemplates.configure access Meteor.settings = undefined #739

Closed Gobliins closed 7 years ago

Gobliins commented 7 years ago

Hi i want to make user registration configurable via meteor config so i did this:

Accounts.js AccountsTemplates.configure({ forbidClientAccountCreation: Meteor.settings.forbiduserreg, ...

Also on the route config: ['signIn', 'signUp', 'resetPwd', 'forgotPwd', 'enrollAccount'].forEach( .. if(Meteor.settings.forbiduserreg == false){ (routeName) => AccountsTemplates.configureRoute(routeName) }

In my settings file settings.json i have this value:

"forbiduserreg":true

But when i start my server i get this error: Uncaught TypeError: Cannot read property 'userreg' of undefined

Is this a Problem because Meteor.settings is not accessable during AccountsTemplates.configure ? How can i fix this issue?

Gobliins commented 7 years ago

OK i found out i can use the 'Meteor.settings.public' modifier.