-
Notifications
You must be signed in to change notification settings - Fork 0
Home
John Kimani edited this page Mar 1, 2023
·
2 revisions
Table of contents
- Documentation on the authentication development features
- Registration
- Login
- Email verification.
- Password reset.
- User roles.
This is a fullstack capstone project developed by Kimani John
Back-end: Django, SQL databases, Swagger and DRF || Front-end: Vite and React with Redux
The base URL variable is set depending on environment primarily revolving between production, testing or development.
Notice: All users in the application belong to the custom User model with custom user creation and super admin creation functions.
- Email
- All user accounts require valid email upon creation verification and activation.
- Each user account is a specific email address one email address can only belong to one account.
- Username
- This field is a unique system identifier therefore each user should have a unique username.
- is_verified
- This field is solely for maintenance. Upon creation each user account email address should be verified.
- Unverified accounts are accessed periodically and subjected to termination.
- is_active
- New accounts are marked to be active.
- In active accounts are flagged periodically and could subjected to termination.
- is_staff
- Default user accounts have no staff permissions to directly interact with models.
- created_at
- This field provided information about when the user registered and successfully joined this platform.
- updated_at
- This field provided data on when a user instance was changed or updated for maintenance purposes.
Endpoint: {{BASE_URL}}/api/v1/auth/register/
Body{JSON}:
{
"email": "validEmailAdress@email.com",
"username": "tasteBolder",
"password": "youCanNeverGuess"
}
Response:
{
"email": "validEmailAdress@email.com",
"username": "tasteBolder"
}
Postman Snippet:
Endpoint: {{BASE_URL}}/api/v1/auth/login/
Body{JSON}:
{
"email": "validEmailAdress@email.com",
"username": "tasteBolder",
"password": "youCanNeverGuess"
}
Response:
{
"email": "validEmailAdress@email.com",
"username": "tasteBolder",
"tokens": "{'refresh-token' : 'xxx-yyy-zzz'},{'access-token':'xxx-yyy-zzz'}"
}
Postman snippet of a verified user account.