feat: implement JWT authentication system

- Add register endpoint with bcrypt password hashing
- Add login endpoint returning JWT tokens
- Add logout endpoint with token blacklisting
- Add /me endpoint for current user info
- Add rate limiting (5/minute) for login attempts using slowapi
- Add user settings GET and PATCH endpoints
- Create auth middleware via get_current_user dependency
- Add UserSettings and UserSettingsUpdate schemas
This commit is contained in:
shokollm
2026-04-08 05:48:38 +00:00
parent f59e595ffd
commit 42640679c7
5 changed files with 129 additions and 19 deletions

View File

@@ -23,6 +23,15 @@ class Token(BaseModel):
token_type: str
class UserSettings(BaseModel):
email: EmailStr
class UserSettingsUpdate(BaseModel):
email: Optional[EmailStr] = None
password: Optional[str] = None
class BotCreate(BaseModel):
name: str
description: Optional[str] = None