This commit is contained in:
JSC
2025-06-28 19:19:54 +02:00
parent ceafed9108
commit 85f420d2f7
5 changed files with 48 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ from datetime import timedelta
from flask import Flask
from flask_jwt_extended import JWTManager
from flask_cors import CORS
from app.services.auth_service import AuthService
from app.database import init_db
@@ -33,6 +34,13 @@ def create_app():
app.config["JWT_ACCESS_COOKIE_PATH"] = "/api/"
app.config["JWT_REFRESH_COOKIE_PATH"] = "/api/auth/refresh"
# Initialize CORS
CORS(app,
origins=["http://localhost:3000"], # Frontend URL
supports_credentials=True, # Allow cookies
allow_headers=["Content-Type", "Authorization"],
methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
# Initialize JWT manager
jwt = JWTManager(app)