Skip to content

Commit aa31704

Browse files
fix: improve domain resolver handling in ApiClient and clean up test formatting
1 parent 18f31d1 commit aa31704

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/auth0_api_python/api_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ async def _resolve_allowed_domains(
143143
allowed_domains = self._allowed_domains
144144
# Dynamic resolver mode
145145
elif callable(self._allowed_domains):
146+
resolver = self._allowed_domains
146147
# Build resolver context
147148
context = {
148149
'request_url': request_url,
@@ -152,7 +153,7 @@ async def _resolve_allowed_domains(
152153

153154
# Invoke resolver (supports both sync and async resolvers)
154155
try:
155-
result = self._allowed_domains(context)
156+
result = resolver(context)
156157
if asyncio.iscoroutine(result) or asyncio.isfuture(result):
157158
result = await result
158159
except Exception as e:

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_normalize_domain_custom_domain():
6565
def test_normalize_domain_multiple_slashes():
6666
"""Test normalization with multiple trailing slashes."""
6767
assert normalize_domain("tenant.auth0.com///") == "https://tenant.auth0.com/"
68-
68+
6969

7070
def test_normalize_domain_rejects_path():
7171
"""Test that domain with path segments is rejected."""

0 commit comments

Comments
 (0)