mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #21072] issue: PWA 500 Error instead of redirecting to login after session expires with Trusted Header Auth / Forward Auth from Authentik #58040
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?
Originally created by @wm-ek on GitHub (Jan 31, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21072
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.7.2
Ollama Version (if applicable)
No response
Operating System
Android 16
Browser (if applicable)
Chrome 144.0
Confirmation
README.md.Expected Behavior
When launching the Open WebUI PWA after the user's session has expired (e.g., after logging out), the application should detect that the user is unauthenticated and seamlessly redirect to the external login page provided by the forward authentication provider.
Actual Behavior
When the PWA is launched after the session has expired, it does not redirect to the login page. Instead, it displays a "500 Internal Server Error" oder "Open WebUI Backend Required" in some cases (could not identify yet when exactly)
Steps to Reproduce
Steps to Reproduce
Configure Open WebUI to use an external forward authentication provider (e.g., Authentik via Traefik).
Key environment variables are set as follows
On an android smartphone, install the Open WebUI application as a PWA ("Add to Home Screen").
Log in successfully via the external authenticator. The app works as expected.
Just log out.
Close the PWA .
Relaunch the PWA using the app icon.
Observe the "500 Internal Server Error" page.
Logs & Screenshots
The server logs remain clean and show no errors. The issue appears to be entirely on the client side.
Browser Console Logs: When the PWA starts in an unauthenticated state, it makes background API requests (e.g., to /api/config). These requests are correctly intercepted by the reverse proxy, which issues a redirect to the external login page. However, the browser blocks this redirect and logs the following errors:
Access to fetch at 'https://auth.example.com/...' (redirected from 'https://app.example.com/api/config') has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
The request ultimately fails with net::ERR_FAILED.
Additional Information
The root cause appears to be a client-side handling issue. The PWA's frontend JavaScript makes a background fetch request upon startup. When the user is unauthenticated, the reverse proxy correctly issues a redirect to the external login page. Browsers block redirects for background fetch requests for security reasons (CORS). The Open WebUI frontend does not handle this specific network failure gracefully and instead falls back to displaying a generic (and incorrect) 500 error page.
@owui-terminator[bot] commented on GitHub (Jan 31, 2026):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#21016 issue:Trusted Header Authentication does not automatically register new users after the first login
by FHaggs • Jan 28, 2026 •
bug#20842 issue: Critical Security Issue - JWT Token Authentication Bypass for API Endpoints
by HarukenM123 • Jan 21, 2026 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@tjbck commented on GitHub (Mar 25, 2026):
Should be addressed in dev.