mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-14 13:25:20 +00:00
Add a background task that periodically refreshes OAuth tokens before they expire, preventing users from having to re-authenticate when MCP OAuth tokens (like Notion) expire after 1 hour. Changes: - Add get_expiring_sessions() method to OAuthSessionTable to query sessions expiring within a specified time window - Enhance OAuthClientManager._perform_token_refresh() to handle unregistered MCP clients by discovering OAuth info from stored tool server config - Add periodic_oauth_token_refresh() background task that runs every 5 minutes and refreshes tokens expiring within 10 minutes - Start the background task in app lifespan with proper cleanup Fixes #19809 |
||
|---|---|---|
| .. | ||
| data | ||
| internal | ||
| migrations | ||
| models | ||
| retrieval | ||
| routers | ||
| socket | ||
| static | ||
| storage | ||
| test | ||
| utils | ||
| __init__.py | ||
| alembic.ini | ||
| config.py | ||
| constants.py | ||
| env.py | ||
| functions.py | ||
| main.py | ||
| tasks.py | ||