User Type

There are two types of users in CabloyJS: anonymous user and registered user. If the user does not login, an anonymous user will be assigned automatically. If the user has already logged in, it will be a authenticated user

Session Expiration

anonymous user and authenticated user both have been configured the default session expiration

We can override session expiration in the file config of the project, For Example:

src/backend/config/config.default.js

// modules
config.modules = {
  'a-base': {
    anonymous = {
      maxAge: 365 * 24 * 3600 * 1000, // 365 days
    },
    authenticated = {
      maxAge: 30 * 24 * 3600 * 1000, // 30 days
    },
  },
};

User Agent

CabloyJS supports the feature of user agent. For example, Mike delegates his authority to Jone, and Jone can access the system as Mike after logging in

CabloyJS provides a complete frontend and backend implementation of the user agent feature, which can be enabled directly through the user’s personal management page

Disable User Agent

The user agent is enabled by default. You can disable this feature through the following configuration

src/front/config/config.{scene}.js

export default{
  modules: {
    'a-user': {
      agent: {
        disabled: true,
      },
    },
  },
};

User Authentication

CabloyJS, based on the passport specification of EggJS, implements a unified user authentication mechanism. Whether it is user/password authentication or GitHub authentication, it can be easily integrated into the system to realize the out of the box authentication feature