Module: Accounts

Configure the Accounts Module

The accounts management system in Unchained Engine is reliant on accounts-js which is employed in unchained:core-users.

unchained:core-users exports 4 values randomValueHex, dbManager, accountsPassword and accountsServer.

  • randomValueHex generates random string which is used for in the login tokens generation process.
  • dbManager an instance of DatabaseManager which is used for database related operations.
  • accountsPassword an instance of AccountsPassword for passwords storage and regulation.
  • accountsServer an instance of AccountsServer for users administration.

You can customize options value defined in accountServer and accountsPassword default values in addition to Unchained defined configuration property values by passing server and/or password objects to accounts module configuration object.

In this example we are customizing session time and verification email sending after sign up defined by Unchained and accountsjs respectively

const options = {
  modules: {
    accounts: {
        server: {
          loginExpirationInDays: 1,
        password: {
            sendVerificationEmailAfterSignup: true
Edit on GitHub