0% found this document useful (0 votes)
3 views3 pages

User Registration and Login API Guide

The document outlines the user registration and login processes for TheKiranAcademy, including API endpoints and request bodies. It specifies acceptance criteria for successful registration and login, handling of duplicate usernames/emails, validation errors, and password security measures. The document emphasizes the importance of password encryption and secure storage in the user account management system.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

User Registration and Login API Guide

The document outlines the user registration and login processes for TheKiranAcademy, including API endpoints and request bodies. It specifies acceptance criteria for successful registration and login, handling of duplicate usernames/emails, validation errors, and password security measures. The document emphasizes the importance of password encryption and secure storage in the user account management system.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TheKiranAcademy

### User Registration

1. **As a new user, I want to create an account so that I can access the
system.**
- **API Endpoint:** `POST /api/register`
- **Request Body:**

{
"firstName": "Rajesh",
"lastName": "Kumar",
"username": "rajesh_kumar",
"email": "[Link]@[Link]",
"password": "securePassword123",
"phoneNumber": "9876543210",
"address": "123 Main Street, Mumbai, India",
"dateOfBirth": "1990-01-01"
}

- **Acceptance Criteria:**
1. **Successful Registration:**
- Given valid user details, the API should create a new user account and
return a success response.
- The user should receive a confirmation message indicating successful
registration.
2. **Duplicate Username/Email:**
- If the `username` or `email` is already in use, the API should return
an error indicating that the username or email already exists.
3. **Validation Errors:**
- If any required fields are missing or invalid (e.g., invalid email format,
weak password), the API should return an error specifying which fields are
invalid.
4. **Password Security:**
- The API should ensure the password meets security requirements
(e.g., minimum length, complexity).
5. **Password Encryption:**
- The API should encrypt the password before saving it to the database.
- The encrypted password should be securely stored and cannot be
retrieved in plain text.

### User Login

2. **As a registered user, I want to log in so that I can access my


account.**
- **API Endpoint:** `POST /api/login`
- **Request Body:**
{
"usernameOrEmail": "[Link]@[Link]",
"password": "securePassword123"
}
- **Acceptance Criteria:**
1. **Successful Login:**
- Given valid credentials, the API should authenticate the user and
return a success response indicating that the login was successful.
- The response should include a message confirming successful login.
2. **Invalid Credentials:**
- If the `usernameOrEmail` or `password` is incorrect, the API should
return an error indicating that the credentials are invalid.
3. **Password Matching:**
- The API should compare the provided password with the encrypted
password stored in the database, ensuring that only the correct password
grants access.

All The Best

You might also like