The noonjs authentication system provides a flexible user registration API where field names such as username and password can be customized in the configuration file. The registration endpoint allows clients to create new user accounts by sending credentials, and noonjs automatically handles validation, password hashing, and user storage.
POST /auth/register
{
"email": "user@example.com",
"password": "securePassword123"
}In noonjs, password hashing is automatically handled when the corresponding field's type is set to "hash" in the configuration file. This ensures that sensitive credentials are securely stored without requiring manual hashing logic. For example, in the config.json file, defining the user schema like this:
{
"users": {
"schema": {
"email": { "type": "string", "unique": true },
"password": { "type": "hash" }
}
}
}By setting "type": "hash", noonjs automatically ensures password security without requiring additional encryption logic, making authentication both secure and convenient.The noonjs authentication system provides a flexible user registration API where field names such as username and password can be customized in the configuration file. The registration endpoint allows clients to create new user accounts by sending credentials, and noonjs automatically handles validation, password hashing, and user storage. For instance, if the configuration specifies username as "mobile" and password as "pin", a POST request to /auth/register would look like this:
POST /auth/register
{
"mobile": "+1234567890",
"pin": "securePin123"
}This flexibility allows developers to adapt the authentication process to their specific application needs.