chat-ui
87bff0a1 - fix(auth): redirect to re-auth on revoked-OAuth 401 from upstream

Commit
19 days ago
fix(auth): redirect to re-auth on revoked-OAuth 401 from upstream When the user revokes the HuggingChat OAuth app on huggingface.co their stored access token starts returning 401 from router.huggingface.co with the "OAuth authorization for app ... revoked" message. The local session doesn't yet know — its expiresAt is still in the future — so chat-ui surfaced the raw upstream error as a toast instead of restarting the OAuth flow. Mirror the existing 402 branch: detect statusCode 401 with the revoked/ scope pattern and redirect to /login?next=<conversation> so triggerOauthFlow issues a fresh session that the user returns to in place.
Author
Parents
Loading