Missing Documentation [about to forbid or to prevent client account creation]

I’m wondering if there is documentation somewhere I’ve not found. I was trying to find out how to disable user account creation, search on the meteor site didn’t give any results but Google did in an old forum post. I.e use “forbidClientAccountCreation : true”
So I then searched for this term on the meteor site and again no results.
So is there additional documentation that would have is type of detail??
Thanks

Check out AccountsServer#onCreateUser(func)

Customize new user creation.

ARGUMENTS

func Function

Called whenever a new user is created. Return the new user object, or throw an Error to abort the creation.

Thanks for this additional info, my question/issue was really more that the setting I found in an old forum post via google is not found when I search the online docs. So either the docs are not complete or the search function is not working. Or I guess this configuration option is no longer available since the old post was from 2015

2015 was very long time ago, and even what was in that old forum post may also have been wrong. Never trust old forum posts! If the stuff can’t be found in the current doc, consider it gone or never existed.

I’ll give the solution posted a try, seems like an easy option …

Accounts.config({
forbidClientAccountCreation: true
});

I can find accounts.ui.config in the docs but not the above, so maybe as you say its no longer available

You mean this one? Accounts (multi-server) | Meteor API Docs

AccountsCommon#config(options)

(accounts-base/accounts_common.js, line 170)

Set global accounts options.

Options

sendVerificationEmail Boolean

New users with an email address will receive an address verification email.

forbidClientAccountCreation Boolean

Calls to createUser from the client will be rejected. In addition, if you are using accounts-ui, the “Create account” link will not be available.

restrictCreationByEmailDomain String or Function

If set to a string, only allows new users if the domain part of their email address matches the string. If set to a function, only allows new users if the function returns true. The function is passed the full email address of the proposed new user. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: Accounts.config({ restrictCreationByEmailDomain: 'school.edu' }) .

I agree that it’s unclear that Accounts is split into two entries, one called “(multi-server)” when 90% of it’s content is useful for single server setups

The search also shows this entry as the last item after a bunch of changelogs when searching for “Accounts.config”

1 Like

Thanks coagmano, yes bit awkward to find for sure. Also limited search capability as putting “forbidClientAccountCreation” which is in the doc you reference does not return any results.
Would be good to have an option to expand the search to include all text within the docs.

1 Like