Skip to content

Commit a97f5ad

Browse files
gambletangambletan
andauthored
fix: URL-encode OAuth error message in redirect URL (open-webui#22415)
- URL-encodes the OAuth error message when constructing the redirect URL in the OIDC callback handler - Without encoding, error messages containing spaces, ampersands, or other special characters produce malformed URLs that the frontend cannot parse correctly - The custom OAuth client callback handler already correctly uses urllib.parse.quote_plus() for the same purpose; this fix brings the OIDC handler in line with that pattern Co-authored-by: gambletan <tan@gambletan.com>
1 parent 138c4cb commit a97f5ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/open_webui/utils/oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ async def handle_callback(self, request, provider, response, db=None):
17061706
redirect_url = f"{redirect_base_url}/auth"
17071707

17081708
if error_message:
1709-
redirect_url = f"{redirect_url}?error={error_message}"
1709+
redirect_url = f"{redirect_url}?error={urllib.parse.quote_plus(error_message)}"
17101710
return RedirectResponse(url=redirect_url, headers=response.headers)
17111711

17121712
response = RedirectResponse(url=redirect_url, headers=response.headers)

0 commit comments

Comments
 (0)