mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #12564] [CLOSED] Fix OIDC logout via end session endpoint #22973
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/12564
Author: @thlehmann-ionos
Created: 4/7/2025
Status: ❌ Closed
Base:
dev← Head:fix-odic-logout-via-end-session-endpoint📝 Commits (2)
7348694refactor(apis/auths): simplify overcomplicated promise + async/await mixupa0051cdfix(UserMenu): with OIDC logout don't follow redirect in fetch📊 Changes
6 files changed (+262 additions, -32 deletions)
View changed files
📝
backend/open_webui/routers/auths.py(+4 -4)➕
src/lib/apis/auths/index.spec.ts(+67 -0)📝
src/lib/apis/auths/index.ts(+11 -17)📝
src/lib/components/layout/Sidebar/UserMenu.svelte(+2 -11)➕
src/lib/services/auths.spec.ts(+156 -0)➕
src/lib/services/auths.ts(+22 -0)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Testing: Have you written and run sufficient tests to validate the changes?(test infrastructure is broken) (manual testing done)Changelog Entry
Description
When OIDC is configured, the session in Open WebUI is invalidated and the user must be redirected to the Auth server's end_session_endpoint to invalidate the session there.
With the previous implementation, the end_session_endpoint was sent as a redirect to the client.
However, since the request is made as Fetch request it has to obey CORS rules.
This would require the Auth server to set Access-Control-Allow-Origin, which is not sensible. If this header is not set, the request would fail, thus the logout would not be completed at the Auth server.
Fixed
end_session_endpoint(before this fix the endpoint was not called due to a CORS error)Screenshots or Videos
Broken
https://github.com/user-attachments/assets/f8493fd1-a464-445a-87f9-f7c97399a140
Fixed
https://github.com/user-attachments/assets/fec16ed3-a826-4b83-b7b5-aee1b5fd0329
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.