Login

The noonjs authentication system provides a customizable login API that supports flexible field names such as username and password. These can be configured in the config.json file. The login endpoint authenticates users by verifying credentials and issuing access tokens.

POST /auth/login 

{
  "email": "user@example.com",
  "password": "securePassword123"
}

Authentication Process

When a user logs in, noonjs verifies the provided credentials against the stored hashed password. If authentication is successful, a JWT access token is generated, allowing secure API interactions.

{
  "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
The generated access token should be included in the authorization header for subsequent requests.

Customizable Fields

Like the registration process, login field names such as username and password can be adapted based on the config.json settings. For example, if the configuration specifies username as "mobile" and password as "pin", the login request would look like this:

POST /auth/login 

{
  "mobile": "+1234567890",
  "pin": "securePin123"
}
This flexibility allows developers to match authentication fields to their application’s specific needs.

Info

The authentication logic can be further customized in the backend. The client simply sends the user object, requiring no additional changes for field mapping.
Edit this page on Github
© 2025 kav3.com. Crafted with and dedication.