mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-09 03:18:18 +00:00
refac
This commit is contained in:
parent
de3317e26b
commit
b8ea267f8e
1 changed files with 5 additions and 1 deletions
|
|
@ -2332,13 +2332,17 @@ async def register_client(request, client_id: str) -> bool:
|
|||
return False
|
||||
|
||||
try:
|
||||
request.app.state.config.TOOL_SERVER_CONNECTIONS[connection_idx] = {
|
||||
connections = request.app.state.config.TOOL_SERVER_CONNECTIONS
|
||||
connections[connection_idx] = {
|
||||
**connection,
|
||||
'info': {
|
||||
**connection.get('info', {}),
|
||||
'oauth_client_info': encrypt_data(oauth_client_info.model_dump(mode='json')),
|
||||
},
|
||||
}
|
||||
# Re-assign the full list to trigger AppConfig.__setattr__ → PersistentConfig.save()
|
||||
# (in-place list mutation via list[idx] = ... does not trigger __setattr__)
|
||||
request.app.state.config.TOOL_SERVER_CONNECTIONS = connections
|
||||
except Exception as e:
|
||||
log.error(f'Failed to persist updated OAuth client info for tool server {client_id}: {e}')
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue