fix: coerce malformed profile JSON to OAuthError; add redirect_uri assertion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -241,8 +241,11 @@ async def fetch_user(provider: ResolvedProvider, token: str) -> dict:
|
||||
except aiohttp.ClientError as exc:
|
||||
raise OAuthError(f"User fetch network error: {exc}") from exc
|
||||
|
||||
for key in provider.profile_data_path:
|
||||
data = data.get(key, {})
|
||||
try:
|
||||
for key in provider.profile_data_path:
|
||||
data = data.get(key, {})
|
||||
except AttributeError:
|
||||
raise OAuthError(f"Unexpected profile response structure from {provider.type}")
|
||||
|
||||
avatar_field = provider.field_map.get("avatar")
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user