DannyJamesHidalgo / pitty-party-api

https://pitty-party-api.vercel.app
0 stars 0 forks source link

Streamline User Registration, Login, and Data Retrieval Processes #4

Closed DannyJamesHidalgo closed 1 month ago

DannyJamesHidalgo commented 1 month ago

I

Title: Streamline User Registration, Login, and Data Retrieval Processes

Description:

This PR enhances our application's user registration, login functionalities, and introduces streamlined access to user data through a dedicated endpoint. These improvements focus on security, usability, and maintaining a clean project structure. The core updates are:

Key Contributions:

Benefits:

Implementation Details:

Testing Instructions via Postman:

  1. Apply Migrations:

    python manage.py makemigrations && python manage.py migrate
  2. Register New User:

    • POST request to http://localhost:8000/register with JSON body:
      {
      "username": "testuser",
      "password": "testpass",
      "email": "test@example.com",
      "first_name": "Test",
      "last_name": "User"
      }
    • Expect token upon successful registration.
  3. Authenticate User:

    • POST request to http://localhost:8000/login with credentials:
      {
      "username": "testuser",
      "password": "testpass"
      }
    • Verify token issuance for authenticated sessions.
  4. Retrieve User Data:

    • GET request to http://localhost:8000/users.
    • Optionally, append /users/<user_id> for specific user details.
    • Use the token obtained during login for authorization in header:
      Authorization: Token <your_token_here>
    • Check for accurate user data retrieval.

Screenshots:

[Include screenshots of Postman tests.]

Additional Context:

These changes solidify our project's foundation, focusing on secure management and efficient access to user functionalities. Streamlining these processes improves the experience and prepares for further developments.

DannyJamesHidalgo commented 1 month ago

token is included in the return

DannyJamesHidalgo commented 1 month ago

tested and approved