Spaces:
Sleeping
Sleeping
Adzacam commited on
Commit 路
5f553ce
1
Parent(s): 76765ac
chore: update password hashing algorithm to pbkdf2_sha256 and relax CORS middleware configurations
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ SECRET_KEY = os.getenv("JWT_SECRET", "super-secret-local-key")
|
|
| 29 |
ALGORITHM = "HS256"
|
| 30 |
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24
|
| 31 |
|
| 32 |
-
pwd_context = CryptContext(schemes=["
|
| 33 |
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/v1/auth/login")
|
| 34 |
|
| 35 |
def verify_password(plain_password, hashed_password):
|
|
@@ -80,15 +80,15 @@ app = FastAPI(
|
|
| 80 |
# CORS: s贸lo permite peticiones desde el frontend registrado
|
| 81 |
_ALLOWED_ORIGINS = [
|
| 82 |
origin.strip()
|
| 83 |
-
for origin in os.getenv("CORS_ALLOWED_ORIGINS", "https://
|
| 84 |
if origin.strip()
|
| 85 |
]
|
| 86 |
app.add_middleware(
|
| 87 |
CORSMiddleware,
|
| 88 |
-
allow_origins=
|
| 89 |
allow_credentials=False,
|
| 90 |
-
allow_methods=["
|
| 91 |
-
allow_headers=["
|
| 92 |
)
|
| 93 |
|
| 94 |
# Valores v谩lidos para el CHECK constraint de Supabase
|
|
|
|
| 29 |
ALGORITHM = "HS256"
|
| 30 |
ACCESS_TOKEN_EXPIRE_MINUTES = 60 * 24
|
| 31 |
|
| 32 |
+
pwd_context = CryptContext(schemes=["pbkdf2_sha256"], deprecated="auto")
|
| 33 |
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/v1/auth/login")
|
| 34 |
|
| 35 |
def verify_password(plain_password, hashed_password):
|
|
|
|
| 80 |
# CORS: s贸lo permite peticiones desde el frontend registrado
|
| 81 |
_ALLOWED_ORIGINS = [
|
| 82 |
origin.strip()
|
| 83 |
+
for origin in os.getenv("CORS_ALLOWED_ORIGINS", "http://localhost:5173,https://giragroup-bi-frontend-tei-jgc45f654-dazz-s-projects.vercel.app,https://giragroup-bi-frontend-tei-ii.vercel.app").split(",")
|
| 84 |
if origin.strip()
|
| 85 |
]
|
| 86 |
app.add_middleware(
|
| 87 |
CORSMiddleware,
|
| 88 |
+
allow_origins=["*"],
|
| 89 |
allow_credentials=False,
|
| 90 |
+
allow_methods=["*"],
|
| 91 |
+
allow_headers=["*"],
|
| 92 |
)
|
| 93 |
|
| 94 |
# Valores v谩lidos para el CHECK constraint de Supabase
|