wjy4528
wjy4528

Reputation: 5

Meteor Account disable create-account function from website

meteor login button ui

I am using the meteor build-up package meteor add accounts-ui and meteor add accounts-password but I would like to disable the create-account function for other users except the administrator or just by using db like db.insert.users(). How could I make it and how could I set a administrator?

header.html

<ul class="nav navbar-nav navbar-right">
          {{> loginButtons}}
 </ul>

Upvotes: 0

Views: 89

Answers (1)

user3374348
user3374348

Reputation: 4101

Put this in your shared code:

Accounts.config({
    forbidClientAccountCreation: true
});

Now no-one can create users directly. You'll have to add a method only accessible to the administrator which uses Accounts.createUser.

Upvotes: 1

Related Questions