Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.04 KB

README.md

File metadata and controls

37 lines (29 loc) · 1.04 KB

accounts-local

Creates local users and an admin.

Usage

Call AccountsLocal.config(users) on the server with the users configuration, which should be a map of usernames to user details:

{
  "admin": {
    "name": "Admin",
    "password": "password",
    "email": "[email protected]",
    "roles": ["admin"]
  },
  "other": {
    "name": "Other User",
    "password": "foobar",
    "email": "[email protected]",
    "roles": ["user"]
  }
}

A private/users.json file could be used for this along with the following code on the server:

Meteor.startup(function() {
  var users = JSON.parse(Assets.getText('users.json'));
  AccountsLocal.config(users);
});

A single admin user with the username "admin" is expected. The details can be passed in the users configuration or set using the following environment variables: METEOR_ADMIN_PASSWORD, METEOR_ADMIN_EMAIL.

Updating the users.json file and restarting the server will update the details of the users. To prevent this, add the following property to the user details: update: false.