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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/15575
Author: @knyl2013
Created: 7/7/2025
Status: ❌ Closed
Base:
dev← Head:sso-redirect-fix📝 Commits (2)
0d978deFix SSO redirect604aeb1Styling📊 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
stateparameter.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.