Role Transformation of Users
Users experience the following role transformation before and after registration
Stage | Role |
---|---|
before registration | anonymous |
after registration | registered |
after activation | activated |
These role transitions are done automatically. The
user activation
feature can be disabled. If this feature is disabled, it will be automatically converted toactivated
after registration
Best practice: by granting different authorizations to the roles of
anonymous
,registered
andactivated
, users can precisely control their permissions at different stages of registration
Activation Ways
Users can activate through mobile
or email
At present, CabloyJSbuilt-in core module
a-authsimpleprovides the activation way of
email`
Activation Customization
CabloyJS provides a general development interface through the module a-base
, and supports different user authentication modules to provide their own activation methods
a-base-sync/backend/src/config/config.js
// account
config.account = {
needActivation: true,
activationWays: 'mobile,email',
url: {
emailConfirm: '/a/authsimple/emailConfirm',
mobileVerify: '',
passwordChange: '/a/authsimple/passwordChange',
passwordForgot: '/a/authsimple/passwordForgot',
passwordReset: '/a/authsimple/passwordReset',
},
// default is 'activated'
activatedRoles: 'activated',
};
Name | Description |
---|---|
needActivation | Whether user activation is required. If not required, set this parameter to false |
activationWays | The activation ways provided by the system. If you don’t need mobile activation way, just delete mobile here |
activatedRoles | The roles automatically transferred in when the user is activated. activated by default. supporting multiple roles |
url.emailConfirm | Page component path for mail confirmation |
url.mobileVerify | Page component path for mobile verification |
url.passwordChange | Page component path for password modification |
url.passwordForgot | Page component path for password finding |
url.passwordReset | Page component path for password reset |
Comments: