From 1318b2a78b6789442b8fe8299755cbf87cf8b04d Mon Sep 17 00:00:00 2001 From: Automated Action Date: Mon, 26 May 2025 14:14:50 +0000 Subject: [PATCH] Update README to document username-based authentication --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e41330..2b1aec6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A full-featured e-commerce API built with FastAPI and SQLite. - **Product Management**: Products with categories, pricing, and inventory management - **Shopping Cart**: Add, update, remove items in user's shopping cart - **Order Processing**: Create orders from cart, track order status -- **Authentication**: JWT-based authentication with role-based access control +- **Authentication**: Username-based JWT authentication with role-based access control ## Tech Stack @@ -23,8 +23,8 @@ A full-featured e-commerce API built with FastAPI and SQLite. ### Authentication -- `POST /api/v1/auth/login`: Login and get access token -- `POST /api/v1/auth/register`: Register a new user +- `POST /api/v1/auth/login`: Login with username and password to get access token +- `POST /api/v1/auth/register`: Register a new user (requires username, email, and password) - `GET /api/v1/auth/me`: Get current user information ### Users @@ -104,6 +104,13 @@ uvicorn main:app --reload The API will be available at http://localhost:8000. +### Authentication Note + +This API uses username-based authentication rather than email-based. When registering and logging in: +- Username is the primary identifier for authentication +- Email is still required during registration but is not used for login +- Password must meet security requirements (minimum 8 characters) + ## Documentation FastAPI provides automatic API documentation: @@ -124,6 +131,10 @@ Apply migrations: alembic upgrade head ``` +#### Recent Migrations + +- **2a3b4c5d6e7f_add_username_field**: Added username field to User model and migrated from email-based to username-based authentication + ### Running Tests ```bash