Fix AVConnect authentication issue
This commit is contained in:
@@ -8,7 +8,7 @@ from core.auth import encrypt_secret
|
||||
from core.database import ApiCredential, get_db
|
||||
from core.dependencies import require_admin
|
||||
from core.schemas import CredentialRead, CredentialUpsert
|
||||
from services.avconnect import validate_credentials
|
||||
from services.avconnect import AVConnectAPI
|
||||
|
||||
router = APIRouter(prefix="/api/admin/credentials", tags=["admin-credentials"])
|
||||
|
||||
@@ -27,7 +27,7 @@ async def upsert_credential(
|
||||
_: dict = Depends(require_admin),
|
||||
):
|
||||
try:
|
||||
ok, session_id = validate_credentials(req.username, req.password)
|
||||
ok, session_id = AVConnectAPI(req.username, req.password).validate_credentials()
|
||||
except Exception as exc:
|
||||
raise HTTPException(502, f"Could not reach AVConnect: {exc}")
|
||||
if not ok:
|
||||
|
||||
Reference in New Issue
Block a user