mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-11 22:52:54 +00:00
chore: keep OAuth token payloads out of logs (#29709)
Two OAuth failure paths interpolated the raw token object into their log message. On the callback path that object is a live credential set, so a provider returning no user data wrote an access token, and usually a refresh token, straight into the application log. Both messages now log without the payload. The token-exchange failure keeps its error level and its client_id binding and reports the provider's error description instead of the raw response body, which by that branch's own condition never contained an access token anyway. The callback failure keeps its warning level and identifies the provider, matching the other failure logs in that handler.
This commit is contained in:
parent
039c4d665e
commit
39c1e86e95
1 changed files with 2 additions and 2 deletions
|
|
@ -1263,7 +1263,7 @@ class OAuthClientManager:
|
|||
if token and not token.get('access_token'):
|
||||
error_desc = token.get('error_description', token.get('error', 'Unknown error'))
|
||||
error_message = f'Token exchange failed: {error_desc}'
|
||||
log.error(f'Invalid token response for client_id {client_id}: {token}')
|
||||
log.error('Invalid token response for client_id %s: %s', client_id, error_desc)
|
||||
token = None
|
||||
|
||||
if token:
|
||||
|
|
@ -1917,7 +1917,7 @@ class OAuthManager:
|
|||
if provider == 'feishu' and isinstance(user_data, dict) and 'data' in user_data:
|
||||
user_data = user_data['data']
|
||||
if not user_data:
|
||||
log.warning(f'OAuth callback failed, user data is missing: {token}')
|
||||
log.warning('OAuth callback failed for provider %s, user data is missing', provider)
|
||||
raise HTTPException(400, detail=ERROR_MESSAGES.INVALID_CRED)
|
||||
|
||||
# Extract the "sub" claim, using custom claim if configured
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue