open-webui/backend
Claude db173da216
fix: renew non-refreshable OAuth tokens instead of deleting the session
Addresses review feedback on #26802: even after stamping a long-lived
expiry, _perform_token_refresh still returned None for tokens without a
refresh_token, so get_oauth_token would delete the session once that
expiry elapsed — reproducing the original bug a year later instead of
hourly.

Flag tokens that carry neither expiry metadata nor a refresh_token with
NON_REFRESHABLE_TOKEN_MARKER in _normalize_token_expiry. When such a
token reaches the refresh path, _renew_non_refreshable_token re-stamps
its local expiry in place and returns it, so the session keeps renewing
itself (Slack xoxp user tokens never expire and never rotate). Tokens
with a real provider-declared expiry but no refresh token are not
flagged and remain untouched: they still expire and require re-auth.

Also fixes the Ruff format failure on the branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JKLX4jqe4E868Zr43ZmzVC
2026-07-09 09:31:05 +00:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
open_webui fix: renew non-refreshable OAuth tokens instead of deleting the session 2026-07-09 09:31:05 +00:00
.dockerignore fix: litellm config issue 2024-02-24 22:35:11 -08:00
.gitignore refac 2024-09-06 04:59:20 +02:00
dev.sh refac 2026-03-24 19:43:30 -05:00
requirements-min.txt chore: bump Python backend dependencies, drop unused peewee (#25786) 2026-06-29 02:02:18 -05:00
requirements.txt chore: bump Python backend dependencies, drop unused peewee (#25786) 2026-06-29 02:02:18 -05:00
start.sh refac 2026-06-17 03:01:11 +02:00
start_windows.bat refac 2026-06-17 03:01:11 +02:00