The unit for account management provides:
The requirements for account name and password are specified in /configuration/units/urb-account-management/accountNameAndPasswordRequirements.js. The constants exported by this module are:
Constant | Description |
---|---|
AccountNameLengthMin |
Minimum length of account name that would allow logging in. |
AccountPasswordLengthMin |
Minimum length of account password that would allow logging in. |
AccountPasswordStrengthMin |
Minimum password score that would allow logging in. Recommended value 60. Password with score below this will show with a red bar. |
AccountPasswordStrengthGood |
Minimum password score which would show as green. Password with score below this will show as yellow. |
The algorithm for scoring the passwords is set in /configuration/units/urb-account-management/scripts/scorePassword.js. One algorithm is provided with the boilerplate, and it has two settings that control its behavior. However, a completely different algorithm can be specified. Here is an example of using the algorithm provided with the boilerplate:
import scorePassword_Simple from '../../../../units/urb-account-management/scripts/scorePassword_Simple'
export default function( pass )
{
return scorePassword_Simple(
pass,
5.0, // uniqueLettersAwardUntilRepetitions
10, // variationAwardCoefficient
)
}
Extensions to the login screen and create profile screen which allow to extend the user interface are in /configuration/units/urb-account-management/webapp/components/AccountManagementExtensions.jsx.
Additional requirements for the account name, and alias for the account name are also specified in /configuration/units/urb-account-management/accountNameAndPasswordRequirements.js:
Constant | Description |
---|---|
AccountNameAlias |
Name that will be used for the text box with the account name. Can be "Handle", "Account name", "E-Mail", etc. |
AccountNameAdditionalValidation |
Function that can specify additional requirements for the account name. |
Here is an example how to make AccountNameAdditionalValidation
require that account names are emails:
import { validateEmail } from '../../../scripts/validation'
// ...
function AccountNameAdditionalValidation( AccountName )
{
return validateEmail( AccountName )
}