mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #14943] [MERGED] Fix double‐slash (//auth) in OAuth callback redirect #46702
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/14943
Author: @jk-f5
Created: 6/12/2025
Status: ✅ Merged
Merged: 6/13/2025
Merged by: @tjbck
Base:
dev← Head:fix/oauth📝 Commits (1)
fced3effix: Trailing slash was never removed from request.base_url because it's not a string but rather a starlette.datastructures.URL📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
backend/open_webui/utils/oauth.py(+1 -1)📄 Description
Summary
Convert the value used to build the OAuth callback redirect URL to a plain string so that a trailing slash can be trimmed correctly. This prevents the generated redirect from containing two slashes (e.g.
https://host//auth) which breaks login when Azure AD / Microsoft OAuth is used.Background
backend/open_webui/utils/oauth.pyconstructs the post-login redirect like this:request.base_urlis astarlette.datastructures.URLobject, not astr. WhenWEBUI_URLis unset and the code falls back torequest.base_url, theisinstance(..., str)check fails, so the trailing slash is not removed. After implicit string conversion we end up with...//auth.Changelog Entry
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.