
- Create User model and database schema - Add JWT authentication with secure password hashing - Create authentication endpoints for registration and login - Update invoice routes to require authentication - Ensure users can only access their own invoices - Update documentation in README.md
19 lines
326 B
Python
19 lines
326 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class Token(BaseModel):
|
|
"""
|
|
Token schema for response
|
|
"""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
|
|
|
|
class TokenPayload(BaseModel):
|
|
"""
|
|
Token payload schema for JWT
|
|
"""
|
|
sub: Optional[str] = None
|
|
exp: Optional[int] = None |