Phase 2 Complete: SQL migration with SQLModel and Alembic
This commit is contained in:
@@ -32,6 +32,7 @@ class UserManager:
|
||||
|
||||
def get_user(self, username: str) -> Optional[UserTable]:
|
||||
"""Get user by username"""
|
||||
from app.models.watchlist import WatchlistItemTable # Force registration
|
||||
with Session(engine) as session:
|
||||
statement = select(UserTable).where(UserTable.username == username)
|
||||
return session.exec(statement).first()
|
||||
@@ -210,6 +211,14 @@ def _save_refresh_tokens(tokens: Dict[str, dict]):
|
||||
logger.error(f"Error saving refresh tokens: {e}")
|
||||
|
||||
|
||||
def _get_jwt_config() -> dict:
|
||||
return {
|
||||
"SECRET_KEY": settings.jwt_secret_key,
|
||||
"ALGORITHM": settings.jwt_algorithm,
|
||||
"ACCESS_TOKEN_EXPIRE_MINUTES": settings.access_token_expire_minutes,
|
||||
"REFRESH_TOKEN_EXPIRE_DAYS": 30
|
||||
}
|
||||
|
||||
def create_access_refresh_tokens(data: dict) -> tuple[str, str]:
|
||||
"""
|
||||
Create both access and refresh tokens.
|
||||
|
||||
Reference in New Issue
Block a user