fix(backend): Refactor OIDC callback and auth dependency to correctly handle cookies and prefix all API routes with /api/v1.
This commit is contained in:
@@ -21,7 +21,7 @@ def auth_header(mock_user):
|
||||
|
||||
def test_stream_agent_unauthorized():
|
||||
"""Test that streaming requires authentication."""
|
||||
response = client.post("/chat/stream", json={"message": "hello"})
|
||||
response = client.post("/api/v1/chat/stream", json={"message": "hello"})
|
||||
assert response.status_code == 401
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@@ -52,7 +52,7 @@ async def test_stream_agent_success(auth_header, mock_user):
|
||||
mock_session.get.return_value = mock_conv
|
||||
|
||||
# Using TestClient with a stream context
|
||||
with client.stream("POST", "/chat/stream",
|
||||
with client.stream("POST", "/api/v1/chat/stream",
|
||||
json={"message": "hello", "thread_id": "t1"},
|
||||
headers=auth_header) as response:
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user