Fix token issue

This commit is contained in:
Urtzi Alfaro
2025-07-18 16:48:49 +02:00
parent 4073222888
commit e92ccb8e0a
8 changed files with 235 additions and 74 deletions

View File

@@ -9,7 +9,7 @@ from typing import List, Optional
from datetime import datetime, timedelta
from app.core.database import get_db
from app.core.auth import verify_token
from app.core.auth import get_current_user, AuthInfo
from app.services.weather_service import WeatherService
from app.services.messaging import data_publisher
from app.schemas.external import (
@@ -26,7 +26,7 @@ weather_service = WeatherService()
async def get_current_weather(
latitude: float = Query(..., description="Latitude"),
longitude: float = Query(..., description="Longitude"),
current_user: dict = Depends(verify_token)
current_user: AuthInfo = Depends(get_current_user)
):
"""Get current weather for location"""
try:
@@ -43,7 +43,7 @@ async def get_weather_forecast(
latitude: float = Query(..., description="Latitude"),
longitude: float = Query(..., description="Longitude"),
days: int = Query(7, description="Number of forecast days", ge=1, le=14),
current_user: dict = Depends(verify_token)
current_user: AuthInfo = Depends(get_current_user)
):
"""Get weather forecast for location"""
try:
@@ -69,7 +69,7 @@ async def get_historical_weather(
start_date: datetime = Query(..., description="Start date"),
end_date: datetime = Query(..., description="End date"),
db: AsyncSession = Depends(get_db),
current_user: dict = Depends(verify_token)
current_user: AuthInfo = Depends(get_current_user)
):
"""Get historical weather data"""
try: