[PR #15575] [CLOSED] Fix: Correct redirect after OAuth login #10672

Closed
opened 2025-11-11 19:10:54 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/15575
Author: @knyl2013
Created: 7/7/2025
Status: Closed

Base: devHead: sso-redirect-fix


📝 Commits (2)

📊 Changes

2 files changed (+50 additions, -7 deletions)

View changed files

📝 backend/open_webui/utils/oauth.py (+27 -2)
📝 src/routes/auth/+page.svelte (+23 -5)

📄 Description

Changelog Entry

Description

Current behaviour: When a user is on a specific page (e.g., a chat or settings) and is prompted to log in, the redirect functionality works correctly for the standard email/password login. But when using an OAuth provider (like Google, GitHub, etc.), the user is always redirected to the root URL (homepage) after a successful login, instead of the last page they were on.

Fixed

This fix ensures the redirect works correctly for the OAuth flow by storing the redirect url inside the OAuth state parameter.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/15575 **Author:** [@knyl2013](https://github.com/knyl2013) **Created:** 7/7/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `sso-redirect-fix` --- ### 📝 Commits (2) - [`0d978de`](https://github.com/open-webui/open-webui/commit/0d978deea65b61c26461d8f363cfa4ae61865c2b) Fix SSO redirect - [`604aeb1`](https://github.com/open-webui/open-webui/commit/604aeb1f39b5730c6d3e10b75d207a38aab575af) Styling ### 📊 Changes **2 files changed** (+50 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/oauth.py` (+27 -2) 📝 `src/routes/auth/+page.svelte` (+23 -5) </details> ### 📄 Description # **Changelog Entry** ### **Description** **Current behaviour:** When a user is on a specific page (e.g., a chat or settings) and is prompted to log in, the redirect functionality works correctly for the standard email/password login. But when using an OAuth provider (like Google, GitHub, etc.), the user is always redirected to the root URL (homepage) after a successful login, instead of the last page they were on. ### **Fixed** This fix ensures the redirect works correctly for the OAuth flow by storing the redirect url inside the OAuth `state` parameter. ### **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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 19:10:54 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#10672