REFACTOR API gateway fix 1
This commit is contained in:
@@ -59,7 +59,7 @@ class UserProxy:
|
||||
try:
|
||||
# Get auth service URL (with service discovery if available)
|
||||
auth_url = await self._get_auth_service_url()
|
||||
target_url = f"{auth_url}/api/v1/user/{path}"
|
||||
target_url = f"{auth_url}/api/v1/users/{path}"
|
||||
|
||||
# Prepare headers (remove hop-by-hop headers)
|
||||
headers = self._prepare_headers(dict(request.headers))
|
||||
@@ -177,12 +177,12 @@ user_proxy = UserProxy()
|
||||
@router.get("/me")
|
||||
async def get_current_user(request: Request):
|
||||
"""Proxy get current user to auth service"""
|
||||
return await user_proxy.forward_request("GET", "/me", request)
|
||||
return await user_proxy.forward_request("GET", "me", request)
|
||||
|
||||
@router.put("/me")
|
||||
async def update_current_user(request: Request):
|
||||
"""Proxy update current user to auth service"""
|
||||
return await user_proxy.forward_request("PUT", "/me", request)
|
||||
return await user_proxy.forward_request("PUT", "me", request)
|
||||
|
||||
# ================================================================
|
||||
# CATCH-ALL ROUTE for any other user endpoints
|
||||
|
||||
Reference in New Issue
Block a user