[PR #4283] [CLOSED] feat: configurable redirect URL for simple SSO no-login flow #4579

Closed
opened 2026-02-22 18:36:07 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4283
Author: @nehaaprasad
Created: 8/13/2025
Status: Closed

Base: masterHead: feat/sso-redirect-url


📝 Commits (4)

  • 1c798c5 When SIMPLE_SSO_ENABLED and SIMPLE_SSO_NO_LOGIN are set, unauthenticated users on /login are redirected to the URL
  • 71cd65a SIMPLE_SSO_NO_LOGIN_REDIRECT_URL if present; otherwise they fall back to /sso/simple.
  • 58496ac absolute URLs are supported using window.location.replace, so you can point to an external middleware.
  • 1204dc5 server exposes the new setting through System.keys() so the frontend can read it.

📊 Changes

4 files changed (+13 additions, -2 deletions)

View changed files

📝 frontend/src/hooks/useSimpleSSO.js (+2 -0)
📝 frontend/src/pages/Login/index.jsx (+8 -2)
📝 server/models/systemSettings.js (+2 -0)
📝 server/utils/helpers/updateENV.js (+1 -0)

📄 Description

Pull Request Type

  • feat

Relevant Issues

resolves #4277

What is in this change?

  • Add new env SIMPLE_SSO_NO_LOGIN_REDIRECT_URL.
  • Expose setting via System.keys() and include in env dump.
  • Redirect unauthenticated users to this URL when SIMPLE_SSO_NO_LOGIN is enabled; fallback to /sso/simple.
  • Support absolute external URLs via window.location.replace.

Updated files:

  • server/models/systemSettings.js
  • server/utils/helpers/updateENV.js
  • frontend/src/hooks/useSimpleSSO.js
  • frontend/src/pages/Login/index.jsx

Additional Information

  • Backwards compatible; no behavior change unless the new env is set.
  • Example:
SIMPLE_SSO_ENABLED=1
SIMPLE_SSO_NO_LOGIN=1
SIMPLE_SSO_NO_LOGIN_REDIRECT_URL=https://middleware.example.com/start

🔄 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/Mintplex-Labs/anything-llm/pull/4283 **Author:** [@nehaaprasad](https://github.com/nehaaprasad) **Created:** 8/13/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat/sso-redirect-url` --- ### 📝 Commits (4) - [`1c798c5`](https://github.com/Mintplex-Labs/anything-llm/commit/1c798c5989de472d712ea4562abea573d2362517) When SIMPLE_SSO_ENABLED and SIMPLE_SSO_NO_LOGIN are set, unauthenticated users on /login are redirected to the URL - [`71cd65a`](https://github.com/Mintplex-Labs/anything-llm/commit/71cd65aa0c5ac6d0411342979fff338d0d19a7e1) SIMPLE_SSO_NO_LOGIN_REDIRECT_URL if present; otherwise they fall back to /sso/simple. - [`58496ac`](https://github.com/Mintplex-Labs/anything-llm/commit/58496ac9f32408d84b0b727f39e644934766c694) absolute URLs are supported using window.location.replace, so you can point to an external middleware. - [`1204dc5`](https://github.com/Mintplex-Labs/anything-llm/commit/1204dc5639d90115391243a58012d4680334d48d) server exposes the new setting through System.keys() so the frontend can read it. ### 📊 Changes **4 files changed** (+13 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/hooks/useSimpleSSO.js` (+2 -0) 📝 `frontend/src/pages/Login/index.jsx` (+8 -2) 📝 `server/models/systemSettings.js` (+2 -0) 📝 `server/utils/helpers/updateENV.js` (+1 -0) </details> ### 📄 Description ### Pull Request Type - [x] ✨ feat ### Relevant Issues resolves #4277 ### What is in this change? - Add new env `SIMPLE_SSO_NO_LOGIN_REDIRECT_URL`. - Expose setting via `System.keys()` and include in env dump. - Redirect unauthenticated users to this URL when `SIMPLE_SSO_NO_LOGIN` is enabled; fallback to `/sso/simple`. - Support absolute external URLs via `window.location.replace`. Updated files: - `server/models/systemSettings.js` - `server/utils/helpers/updateENV.js` - `frontend/src/hooks/useSimpleSSO.js` - `frontend/src/pages/Login/index.jsx` ### Additional Information - Backwards compatible; no behavior change unless the new env is set. - Example: ```bash SIMPLE_SSO_ENABLED=1 SIMPLE_SSO_NO_LOGIN=1 SIMPLE_SSO_NO_LOGIN_REDIRECT_URL=https://middleware.example.com/start ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:07 -05:00
yindo closed this issue 2026-02-22 18:36:07 -05:00
yindo changed title from [PR #4283] feat: configurable redirect URL for simple SSO no-login flow to [PR #4283] [CLOSED] feat: configurable redirect URL for simple SSO no-login flow 2026-06-05 15:19:17 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4579