fix auth
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user