Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: remove sso related code (#21584)

Lynn61eea6e8b0ea
diff --git a/conf/service_conf.yaml b/conf/service_conf.yaml
index 30a6539dc9..4d40e16eea 100644
--- a/conf/service_conf.yaml
+++ b/conf/service_conf.yaml
@@ -192,29 +192,6 @@ gcs:
# asr_model:
# model: 'whisper-large-v3' # alias of name
# image2text_model: ''
-# oauth:
-# oauth2:
-# display_name: "OAuth2"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# authorization_url: "https://your-oauth-provider.com/oauth/authorize"
-# token_url: "https://your-oauth-provider.com/oauth/token"
-# userinfo_url: "https://your-oauth-provider.com/oauth/userinfo"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/oauth2/callback"
-# oidc:
-# display_name: "OIDC"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# issuer: "https://your-oauth-provider.com/oidc"
-# scope: "openid email profile"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/oidc/callback"
-# github:
-# type: "github"
-# icon: "github"
-# display_name: "Github"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/github/callback"
# authentication:
# client:
# switch: false
diff --git a/docker/.env b/docker/.env
index 45050e4aa4..168a86fe2f 100644
--- a/docker/.env
+++ b/docker/.env
@@ -496,9 +496,6 @@ DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
# Used for ThreadPoolExecutor
THREAD_POOL_MAX_WORKERS=128
-#Option to disable login form for SSO
-DISABLE_PASSWORD_LOGIN=false
-
# -----------------------------------------------------------------------------
# Knowledge compilation
# -----------------------------------------------------------------------------
@@ -543,13 +540,6 @@ LLM_POOL_RATE_LIMIT_RETRY_MAX_DELAY=30.0
# before cancelling them. Only has an effect when MAX_TASKS_PER_WORKER > 0.
# RECYCLE_SHUTDOWN_TIMEOUT=300
-#Option to disable login form for SSO
-DISABLE_PASSWORD_LOGIN=false
-
-# Option to allow OAuth/OIDC just-in-time user provisioning. Independent of
-# REGISTER_ENABLED: set to false to require that an OAuth/OIDC user already exists.
-OAUTH_AUTO_REGISTER=true
-
# -----------------------------------------------------------------------------
# DeepDoc (in-process)
# -----------------------------------------------------------------------------
diff --git a/docker/README.md b/docker/README.md
index ef6914effe..5e89bd6b6b 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -233,21 +233,6 @@ In the RAGFlow open-source 1.0 release, DeepDoc uses CPU inference.
- `addressing_style`: Optional. The style of addressing to use for the S3 endpoint. This can be `path` or `virtual`.
- `prefix_path`: Optional. A prefix path to prepend to file names in the S3 bucket, which can help organize files within the bucket.
-- `oauth`
- The OAuth configuration for signing up or signing in to RAGFlow using a third-party account.
- - `<channel>`: Custom channel ID.
- - `type`: Authentication type, options include `oauth2`, `oidc`, `github`. Default is `oauth2`, when `issuer` parameter is provided, defaults to `oidc`.
- - `icon`: Icon ID, options include `github`, `sso`, default is `sso`.
- - `display_name`: Channel name, defaults to the Title Case format of the channel ID.
- - `client_id`: Required, unique identifier assigned to the client application.
- - `client_secret`: Required, secret key for the client application, used for communication with the authentication server.
- - `authorization_url`: Base URL for obtaining user authorization.
- - `token_url`: URL for exchanging authorization code and obtaining access token.
- - `userinfo_url`: URL for obtaining user information (username, email, etc.).
- - `issuer`: Base URL of the identity provider. OIDC clients can dynamically obtain the identity provider's metadata (`authorization_url`, `token_url`, `userinfo_url`) through `issuer`.
- - `scope`: Requested permission scope, a space-separated string. For example, `openid profile email`.
- - `redirect_uri`: Required, URI to which the authorization server redirects during the authentication flow to return results. Must match the callback URI registered with the authentication server. Format: `https://your-app.com/api/v1/auth/oauth/<channel>/callback`. For local configuration, you can directly use `http://127.0.0.1:80/api/v1/auth/oauth/<channel>/callback`.
-
## πŸ“‹ Setup Examples
### πŸ”’ HTTPS Setup
diff --git a/docker/service_conf.yaml.template b/docker/service_conf.yaml.template
index afaef12931..54f1277e34 100644
--- a/docker/service_conf.yaml.template
+++ b/docker/service_conf.yaml.template
@@ -208,29 +208,6 @@ user_default_llm:
# asr_model:
# model: 'whisper-large-v3' # alias of name
# image2text_model: ''
-# oauth:
-# oauth2:
-# display_name: "OAuth2"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# authorization_url: "https://your-oauth-provider.com/oauth/authorize"
-# token_url: "https://your-oauth-provider.com/oauth/token"
-# userinfo_url: "https://your-oauth-provider.com/oauth/userinfo"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/oauth2/callback"
-# oidc:
-# display_name: "OIDC"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# issuer: "https://your-oauth-provider.com/oidc"
-# scope: "openid email profile"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/oidc/callback"
-# github:
-# type: "github"
-# icon: "github"
-# display_name: "Github"
-# client_id: "your_client_id"
-# client_secret: "your_client_secret"
-# redirect_uri: "https://your-app.com/api/v1/auth/oauth/github/callback"
# authentication:
# client:
# switch: false
@@ -238,7 +215,6 @@ user_default_llm:
# http_secret_key:
# site:
# switch: false
-# disable_password_login: false
# permission:
# switch: false
# component: false
diff --git a/internal/admin/handler_variables_test.go b/internal/admin/handler_variables_test.go
index e9b4cabb20..1cbe294ff4 100644
--- a/internal/admin/handler_variables_test.go
+++ b/internal/admin/handler_variables_test.go
@@ -62,7 +62,7 @@ func putVariable(t *testing.T, h *Handler, body string) setVariableResponse {
}
// TestSetVariableFlattensNativeJSONScalars covers the reported regression: the
-// admin console toggles SSO with a JSON boolean, and a string-typed request
+// admin console sends a JSON boolean for a toggle, and a string-typed request
// field used to reject it as a missing var_name.
func TestSetVariableFlattensNativeJSONScalars(t *testing.T) {
gin.SetMode(gin.TestMode)
@@ -74,15 +74,15 @@ func TestSetVariableFlattensNativeJSONScalars(t *testing.T) {
wantValue string
}{
{
- name: "sso enable sends true",
- varName: "feishu|sso.enabled",
- body: `{"var_name":"feishu|sso.enabled","var_value":true}`,
+ name: "bool true keeps its literal",
+ varName: "mail.enabled",
+ body: `{"var_name":"mail.enabled","var_value":true}`,
wantValue: "true",
},
{
- name: "sso disable sends false",
- varName: "feishu|sso.enabled",
- body: `{"var_name":"feishu|sso.enabled","var_value":false}`,
+ name: "bool false keeps its literal",
+ varName: "mail.enabled",
+ body: `{"var_name":"mail.enabled","var_value":false}`,
wantValue: "false",
},
{
@@ -137,15 +137,15 @@ func TestSetVariableUpdatesExistingSetting(t *testing.T) {
gin.SetMode(gin.TestMode)
handler, db := setupSetVariableHandler(t)
- if response := putVariable(t, handler, `{"var_name":"feishu|sso.enabled","var_value":true}`); response.Code != int(common.CodeSuccess) {
+ if response := putVariable(t, handler, `{"var_name":"mail.enabled","var_value":true}`); response.Code != int(common.CodeSuccess) {
t.Fatalf("enable: code = %d, message = %s", response.Code, response.Message)
}
- if response := putVariable(t, handler, `{"var_name":"feishu|sso.enabled","var_value":false}`); response.Code != int(common.CodeSuccess) {
+ if response := putVariable(t, handler, `{"var_name":"mail.enabled","var_value":false}`); response.Code != int(common.CodeSuccess) {
t.Fatalf("disable: code = %d, message = %s", response.Code, response.Message)
}
var stored entity.SystemSettings
- if err := db.Where("name = ?", "feishu|sso.enabled").First(&stored).Error; err != nil {
+ if err := db.Where("name = ?", "mail.enabled").First(&stored).Error; err != nil {
t.Fatalf("load stored setting: %v", err)
}
if stored.Value != "false" {
@@ -190,9 +190,9 @@ func TestSetVariableRejectsUnusableRequests(t *testing.T) {
// A value rejected by ValidateSystemSettingValue surfaces as a
// server error, which is the pre-existing contract of this endpoint.
name: "bool-typed setting rejects non bool",
- body: `{"var_name":"feishu|sso.enabled","var_value":"yes"}`,
+ body: `{"var_name":"mail.enabled","var_value":"yes"}`,
wantCode: common.CodeServerError,
- wantMessage: "invalid bool value for feishu|sso.enabled: expected true or false",
+ wantMessage: "invalid bool value for mail.enabled: expected true or false",
},
{
// Falsy scalars are legitimate values, not missing fields.
diff --git a/internal/common/environments.go b/internal/common/environments.go
index 6c1e737cd7..f1fab34ff9 100644
--- a/internal/common/environments.go
+++ b/internal/common/environments.go
@@ -267,7 +267,6 @@ const (
EnvFirecrawlRelayTimeout = "FIRECRAWL_RELAY_TIMEOUT"
EnvRAGFlowSecretKey = "RAGFLOW_SECRET_KEY"
EnvEnableRegister = "ENABLE_REGISTER"
- EnvDisablePasswordLogin = "DISABLE_PASSWORD_LOGIN"
EnvMinioHost = "MINIO_HOST"
EnvMinioRegion = "MINIO_REGION"
EnvLang = "LANG"
diff --git a/internal/handler/auth.go b/internal/handler/auth.go
index cf9c185e36..718464a39e 100644
--- a/internal/handler/auth.go
+++ b/internal/handler/auth.go
@@ -86,7 +86,7 @@ func (h *AuthHandler) BetaAuthMiddleware() gin.HandlerFunc {
ctx := c.Request.Context()
auth := c.GetHeader("Authorization")
if auth == "" {
- if cookie, err := c.Cookie(oauthAuthCookie); err == nil {
+ if cookie, err := c.Cookie(authCookie); err == nil {
auth = cookie
}
}
diff --git a/internal/handler/error.go b/internal/handler/error.go
index db364940f4..e89c092d1c 100644
--- a/internal/handler/error.go
+++ b/internal/handler/error.go
@@ -41,14 +41,12 @@ func jsonInternalError(c *gin.Context, err error) {
// HandleNoRoute handles requests to undefined routes
func HandleNoRoute(c *gin.Context) {
- // Python parity: GET /api/v1/auth/login/ (an empty OAuth channel) resolves
- // to a Werkzeug MethodNotAllowed in the Python API, which
- // server_error_response renders as HTTP 200 / code 100 with the
- // exception's repr() as the message. gin instead falls through to
- // NoRoute, so emit the same body here to keep the auth error paths
- // byte-for-byte aligned.
- if (c.Request.Method == http.MethodGet && c.Request.URL.Path == "/api/v1/auth/login/") ||
- (c.Request.Method == http.MethodPost && c.Request.URL.Path == "/api/v1/chats//sessions") ||
+ // Python parity: these malformed paths resolved to a Werkzeug
+ // MethodNotAllowed in the Python API, which server_error_response renders
+ // as HTTP 200 / code 100 with the exception's repr() as the message. gin
+ // instead falls through to NoRoute, so emit the same body here to keep the
+ // error paths byte-for-byte aligned.
+ if (c.Request.Method == http.MethodPost && c.Request.URL.Path == "/api/v1/chats//sessions") ||
(c.Request.Method == http.MethodPatch && strings.HasSuffix(c.Request.URL.Path, "/sessions/")) {
common.ResponseWithCodeData(c, common.CodeExceptionError, false, "<MethodNotAllowed '405: Method Not Allowed'>")
return
diff --git a/internal/handler/user.go b/internal/handler/user.go
index 21de728bc0..8e7bce42da 100644
--- a/internal/handler/user.go
+++ b/internal/handler/user.go
@@ -45,25 +45,21 @@ func NewUserHandler(userService *service.UserService) *UserHandler {
}
}
-// oauthAuthCookie is the cookie the callback writes on success, so the SPA
-// can pick up the signed access token after the redirect. The frontend
-// reads it and either re-issues the value as an Authorization header on
-// subsequent API calls or hands it off to its own token store. Not
-// HttpOnly so the SPA's JS can read it.
-const oauthAuthCookie = "ragflow_auth"
-
-// setOAuthAuthCookie writes the signed access token so the SPA can pick it
-// up after the redirect. Not HttpOnly so the SPA can copy it into its
-// Authorization header on subsequent fetches. The server checks the token
-// signature and expiry on each request.
-func setOAuthAuthCookie(c *gin.Context, token string) {
- // the SPA's bootstrap credential after the OAuth redirect. The
- // SPA reads it via document.cookie and copies it into the
- // Authorization header. Setting HttpOnly would break the login
- // flow. The API validates the token signature and expiry on each request.
- // codeql[go/cookie-httponly-not-set] Intentional: this cookie is
+// authCookie carries the signed access token to the SPA after login so its
+// JavaScript can send it back as an Authorization header on later requests.
+// Not HttpOnly because the SPA has to read it; the server validates the token
+// signature and expiry on every request.
+const authCookie = "ragflow_auth"
+
+// setAuthCookie writes the signed access token so the SPA can send it back as
+// a bearer token. Not HttpOnly so the SPA can copy it into its Authorization
+// header. The server checks the token signature and expiry on each request.
+func setAuthCookie(c *gin.Context, token string) {
+ // codeql[go/cookie-httponly-not-set] Intentional: the SPA reads the cookie
+ // via document.cookie, and the API validates the token signature and
+ // expiry on each request.
http.SetCookie(c.Writer, &http.Cookie{
- Name: oauthAuthCookie,
+ Name: authCookie,
Value: token,
Path: "/",
MaxAge: 60 * 60 * 24 * 7,
@@ -110,7 +106,7 @@ func (h *UserHandler) Register(c *gin.Context) {
}
c.Header("Authorization", authToken)
- setOAuthAuthCookie(c, authToken)
+ setAuthCookie(c, authToken)
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "*")
c.Header("Access-Control-Allow-Headers", "*")
@@ -188,7 +184,7 @@ func (h *UserHandler) Login(c *gin.Context) {
// Set Authorization header with signed token
c.Header("Authorization", authToken)
- setOAuthAuthCookie(c, authToken)
+ setAuthCookie(c, authToken)
// Set CORS headers
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "*")
@@ -279,7 +275,7 @@ func (h *UserHandler) LoginByEmail(c *gin.Context) {
operationLog.DurationMS = time.Since(startAt).Milliseconds()
return
}
- setOAuthAuthCookie(c, authToken)
+ setAuthCookie(c, authToken)
c.Header("Authorization", authToken)
c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "*")
@@ -343,7 +339,7 @@ func (h *UserHandler) Logout(c *gin.Context) {
}()
http.SetCookie(c.Writer, &http.Cookie{
- Name: oauthAuthCookie,
+ Name: authCookie,
Value: "",
Path: "/",
MaxAge: -1,
@@ -480,22 +476,6 @@ func (h *UserHandler) ChangePassword(c *gin.Context) {
common.SuccessWithData(c, true, "password changed successfully")
}
-// GetLoginChannels get all supported authentication channels
-// @Summary Get Login Channels
-// @Description Get all supported OAuth authentication channels
-// @Tags users
-// @Success 200 {object} map[string]interface{}
-// @Router /v1/user/login/channels [get]
-func (h *UserHandler) GetLoginChannelsDeprecated(c *gin.Context) {
- channels, code, err := h.userService.GetLoginChannels()
- if err != nil {
- common.ResponseWithCodeData(c, code, []interface{}{}, "Load channels failure, error: "+err.Error())
- return
- }
-
- common.SuccessWithData(c, channels, "success")
-}
-
// SetTenantInfo update tenant information
// @Summary Set Tenant Info
// @Description Update tenant model configuration
diff --git a/internal/handler/user_auth_ee.go b/internal/handler/user_auth_ee.go
index ff12800e6d..2b164d12bb 100644
--- a/internal/handler/user_auth_ee.go
+++ b/internal/handler/user_auth_ee.go
@@ -24,30 +24,6 @@ import (
"github.com/gin-gonic/gin"
)
-func (h *UserHandler) OAuthCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthCallback not implemented")
-}
-
-func (h *UserHandler) GitHubAuthCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "GitHubAuthCallback not implemented")
-}
-
-func (h *UserHandler) LarkAuthCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "LarkAuthCallback not implemented")
-}
-
-func (h *UserHandler) ICBCAuthCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "ICBCAuthCallback not implemented")
-}
-
-func (h *UserHandler) AzureAuthCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "AzureAuthCallback not implemented")
-}
-
-func (h *UserHandler) AzureAuthLogin(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "AzureAuthLogin not implemented")
-}
-
func (h *UserHandler) Captcha(c *gin.Context) {
common.ErrorWithCode(c, common.CodeNotImplemented, "Captcha not implemented")
}
@@ -68,18 +44,6 @@ func (h *UserHandler) GetMeta(c *gin.Context) {
common.ErrorWithCode(c, common.CodeNotImplemented, "GetMeta not implemented")
}
-func (h *UserHandler) OAuthLogin(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthLogin not implemented")
-}
-
-func (h *UserHandler) OAuthChannelCallback(c *gin.Context) {
- common.ErrorWithCode(c, common.CodeNotImplemented, "OAuthChannelCallback not implemented")
-}
-
-func (h *UserHandler) GetLoginChannels(c *gin.Context) {
- common.SuccessWithData(c, []interface{}{}, "success")
-}
-
func issueUserAccessToken(user *entity.User, secretKey string) (string, error) {
if user == nil || user.AccessToken == nil {
return "", fmt.Errorf("user access token is missing")
diff --git a/internal/router/router_ee.go b/internal/router/router_ee.go
index 67959a6c4f..ffa8835e7f 100644
--- a/internal/router/router_ee.go
+++ b/internal/router/router_ee.go
@@ -25,15 +25,6 @@ func SetupEERouter(engine *gin.Engine) {
func RegisterEENoAuthRouter(apiNoAuth *gin.RouterGroup, r *Router) {
// For EE
- apiNoAuth.GET("/auth/login/channels", r.userHandler.GetLoginChannels)
- apiNoAuth.GET("/auth/login/:channel", r.userHandler.OAuthLogin)
- apiNoAuth.GET("/auth/oauth/:channel/callback", r.userHandler.OAuthChannelCallback)
- apiNoAuth.GET("/auth/oauth/callback", r.userHandler.OAuthCallback)
- apiNoAuth.GET("/auth/oauth/github/callback", r.userHandler.GitHubAuthCallback)
- apiNoAuth.GET("/auth/oauth/lark/callback", r.userHandler.LarkAuthCallback)
- apiNoAuth.GET("/auth/icbc/callback", r.userHandler.ICBCAuthCallback)
- apiNoAuth.GET("/auth/azure/callback", r.userHandler.AzureAuthCallback)
- apiNoAuth.GET("/auth/azure/login", r.userHandler.AzureAuthLogin)
apiNoAuth.POST("/auth/register/captcha", r.userHandler.Captcha)
apiNoAuth.POST("/auth/register/otp", r.userHandler.SendOTP)
apiNoAuth.POST("/auth/register/otp/verify", r.userHandler.VerifyOTP)
diff --git a/internal/server/config.go b/internal/server/config.go
index a610d96b09..6920acbb75 100644
--- a/internal/server/config.go
+++ b/internal/server/config.go
@@ -156,11 +156,6 @@ func Init(configPath string) error {
return fmt.Errorf("parse default models config error: %w", err)
}
- err = globalConfig.ParseOAuthConfig(v)
- if err != nil {
- return fmt.Errorf("parse OAuth config error: %w", err)
- }
-
return nil
}
diff --git a/internal/server/config/api_server_config.go b/internal/server/config/api_server_config.go
index 017ce9a9f4..14205c62e1 100644
--- a/internal/server/config/api_server_config.go
+++ b/internal/server/config/api_server_config.go
@@ -30,8 +30,7 @@ const (
)
type AuthenticationConfig struct {
- DisablePasswordLogin bool `mapstructure:"disable_password_login"`
- EnableRegister bool `mapstructure:"enable_register"`
+ EnableRegister bool `mapstructure:"enable_register"`
}
type APIServerConfig struct {
@@ -94,7 +93,6 @@ func (c *Config) ParseAPIServerConfig(v *viper.Viper) error {
func (c *Config) parseAuthenticationConfig(v *viper.Viper) {
apiServerConfig := &c.apiServer
- apiServerConfig.Authentication.DisablePasswordLogin = false
apiServerConfig.Authentication.EnableRegister = true
if !v.IsSet("authentication") {
@@ -105,22 +103,11 @@ func (c *Config) parseAuthenticationConfig(v *viper.Viper) {
return
}
- if sub.IsSet("disable_password_login") {
- apiServerConfig.Authentication.DisablePasswordLogin = sub.GetBool("disable_password_login")
- }
-
if sub.IsSet("enable_register") {
apiServerConfig.Authentication.EnableRegister = sub.GetBool("enable_register")
}
}
-func (c *Config) DisablePasswordLogin() bool {
- if c.environments.DisablePasswordLogin != nil {
- return *c.environments.DisablePasswordLogin
- }
- return c.apiServer.Authentication.DisablePasswordLogin
-}
-
func (c *Config) EnableRegister() bool {
if c.environments.EnableRegister != nil {
return *c.environments.EnableRegister
diff --git a/internal/server/config/base.go b/internal/server/config/base.go
index 1ffacd2164..25bbaa68d2 100644
--- a/internal/server/config/base.go
+++ b/internal/server/config/base.go
@@ -43,5 +43,4 @@ type Config struct {
// For EE
defaultModels DefaultModelsConfig
billing BillingConfig
- oAuth OAuthConfig
}
diff --git a/internal/server/config/environments.go b/internal/server/config/environments.go
index 94baae6b7e..ccdac0213c 100644
--- a/internal/server/config/environments.go
+++ b/internal/server/config/environments.go
@@ -30,8 +30,7 @@ type Environments struct {
SecretKey string `mapstructure:"secret_key"`
- EnableRegister *bool `mapstructure:"enable_register"`
- DisablePasswordLogin *bool `mapstructure:"disable_password_login"`
+ EnableRegister *bool `mapstructure:"enable_register"`
DocumentEngineType string `mapstructure:"document_engine_type"`
DatabaseType string `mapstructure:"database_type"`
@@ -144,18 +143,6 @@ func (c *Config) GetEnvironments() error {
}
}
- if envVal := common.GetEnv(common.EnvDisablePasswordLogin); envVal != "" {
- if c.environments.DisablePasswordLogin == nil {
- c.environments.DisablePasswordLogin = new(bool)
- }
- str := envVal
- if str == "true" || str == "1" || str == "yes" {
- *c.environments.DisablePasswordLogin = true
- } else {
- *c.environments.DisablePasswordLogin = false
- }
- }
-
// Doc engine
docEngine := common.GetEnvSmall(common.EnvDocEngine)
if docEngine != "" {
@@ -600,10 +587,6 @@ func (c *Config) GetEnvEnableRegister() bool {
return *c.environments.EnableRegister
}
-func (c *Config) GetEnvDisablePasswordLogin() bool {
- return *c.environments.DisablePasswordLogin
-}
-
func (c *Config) GetEnvDocumentEngineType() string {
return c.environments.DocumentEngineType
}
diff --git a/internal/server/config/oauth_ee.go b/internal/server/config/oauth_ee.go
deleted file mode 100644
index 87a7020668..0000000000
--- a/internal/server/config/oauth_ee.go
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package config
-
-import "github.com/spf13/viper"
-
-type OAuthConfig struct {
-}
-
-func (c *Config) ParseOAuthConfig(v *viper.Viper) error {
- return nil
-}
diff --git a/internal/server/config_getallconfigs_test.go b/internal/server/config_getallconfigs_test.go
index 92f215c701..a3897f600c 100644
--- a/internal/server/config_getallconfigs_test.go
+++ b/internal/server/config_getallconfigs_test.go
@@ -46,7 +46,7 @@ backends:
- password: ""
- password: null
password_policy: strict
-disable_password_login: true
+enable_register: true
max_token: 64
`)); err != nil {
t.Fatal(err)
@@ -80,10 +80,10 @@ max_token: 64
map[string]any{"password": "******"},
map[string]any{"password": "******"},
},
- "credentials": wantCredentials,
- "password_policy": "strict",
- "disable_password_login": true,
- "max_token": int64(64),
+ "credentials": wantCredentials,
+ "password_policy": "strict",
+ "enable_register": true,
+ "max_token": int64(64),
}
if !reflect.DeepEqual(settings, want) {
t.Fatalf("logged settings = %#v, want %#v", settings, want)
diff --git a/internal/service/oauth_ee.go b/internal/service/oauth_ee.go
deleted file mode 100644
index 0e59a2af48..0000000000
--- a/internal/service/oauth_ee.go
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package service
-
-import (
- "context"
- "fmt"
- "ragflow/internal/common"
- "ragflow/internal/engine/kvrocks"
- "ragflow/internal/entity"
- "time"
-)
-
-// OAuthLoginInit prepares a redirect to the channel's authorization URL.
-// The returned state must also be set as a short-lived cookie on the caller
-// so the callback can perform a CSRF check that ties the state token to the
-// browser that initiated the flow.
-type OAuthLoginInit struct {
- State string
- AuthURL string
- Channel string
- CookieMaxAge time.Duration
-}
-
-// OAuthCallbackResult is returned to the handler after a successful callback
-// so it can mint the user-facing auth response (cookie + redirect).
-type OAuthCallbackResult struct {
- User *entity.User
- IsNewUser bool
-}
-
-func (s *UserService) OAuthLoginInitiate(channel string, redis *kvrocks.Client) (*OAuthLoginInit, common.ErrorCode, error) {
- return nil, common.CodeServerError, fmt.Errorf("oauth login initiate not implemented")
-}
-
-func (s *UserService) OAuthCallback(ctx context.Context, channel, code, callbackState, expectedState string, redis *kvrocks.Client) (*OAuthCallbackResult, common.ErrorCode, error) {
- return nil, common.CodeDataError, fmt.Errorf("oauth callback not implemented")
-}
diff --git a/internal/service/system.go b/internal/service/system.go
index e0587a91b8..78a464a435 100644
--- a/internal/service/system.go
+++ b/internal/service/system.go
@@ -41,16 +41,14 @@ func NewSystemService() *SystemService {
// ConfigResponse system configuration response
type ConfigResponse struct {
- EnableRegister bool `json:"registerEnabled"`
- DisablePasswordLogin bool `json:"disablePasswordLogin"`
+ EnableRegister bool `json:"registerEnabled"`
}
// GetConfig get system configuration
func (s *SystemService) GetConfig() (*ConfigResponse, error) {
cfg := server.GetConfig()
return &ConfigResponse{
- EnableRegister: cfg.EnableRegister(),
- DisablePasswordLogin: cfg.DisablePasswordLogin(),
+ EnableRegister: cfg.EnableRegister(),
}, nil
}
diff --git a/internal/service/user_ee.go b/internal/service/user_ee.go
deleted file mode 100644
index 8de2ca19a5..0000000000
--- a/internal/service/user_ee.go
+++ /dev/null
@@ -1,32 +0,0 @@
-//
-// Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-package service
-
-import "ragflow/internal/common"
-
-type LoginChannel struct {
- Channel string `json:"channel"`
- DisplayName string `json:"display_name"`
- Icon string `json:"icon"`
-}
-
-// GetLoginChannels gets all supported authentication channels
-func (s *UserService) GetLoginChannels() ([]*LoginChannel, common.ErrorCode, error) {
- channels := make([]*LoginChannel, 0)
-
- return channels, common.CodeSuccess, nil
-}
diff --git a/test/api/system_api_test.go b/test/api/system_api_test.go
index 9516cffbc9..c994c76f87 100644
--- a/test/api/system_api_test.go
+++ b/test/api/system_api_test.go
@@ -27,10 +27,8 @@ func TestRESTSystemPublicContracts(t *testing.T) {
}
systemConfig := restOK(t, restCall(t, &config, http.MethodGet, "/system/config", nil, nil))
configData := object(t, systemConfig["data"])
- for _, key := range []string{"registerEnabled", "disablePasswordLogin"} {
- if _, ok := configData[key]; !ok {
- t.Fatalf("system config missing %q: %v", key, configData)
- }
+ if _, ok := configData["registerEnabled"]; !ok {
+ t.Fatalf("system config missing %q: %v", "registerEnabled", configData)
}
health := restCall(t, &config, http.MethodGet, "/system/healthz", nil, nil)
if health.Status != http.StatusOK && health.Status != http.StatusInternalServerError {
diff --git a/web/src/assets/svg/sso.svg b/web/src/assets/svg/sso.svg
deleted file mode 100644
index 0925d4fd18..0000000000
--- a/web/src/assets/svg/sso.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg t="1746329730618" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3652" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink">
-<path d="M434.286835 669.519808L284.185447 511.738503a31.249664 31.249664 0 0 1 1.023989-44.231525 31.249664 31.249664 0 0 1 44.231525 1.023989l106.791853 112.319793a31.341663 31.341663 0 0 0 44.231525 1.125988L696.095022 376.585955a31.249664 31.249664 0 0 1 44.231525 1.125988 31.249664 31.249664 0 0 1-1.023989 44.231524L478.52036 670.543797c-12.593865 11.876872-32.355652 11.466877-44.232525-1.023989" fill="#74BEFF" p-id="3653"></path>
-<path d="M510.567015 1023.989l-6.859926-1.535983a645.171069 645.171069 0 0 1-356.416171-219.930638 314.506622 314.506622 0 0 1-68.292267-199.657855V164.538232c0-15.051838 10.647886-27.9527 25.391728-30.819668A1615.736643 1615.736643 0 0 0 492.751207 6.142934l6.44993-3.070967a31.495662 31.495662 0 0 1 27.133709 0 1531.566548 1531.566548 0 0 0 391.123798 129.930604l2.149977 0.306997a31.228665 31.228665 0 0 1 26.723713 31.024667v433.103347a316.246603 316.246603 0 0 1-65.938291 196.48389 645.509066 645.509066 0 0 1-363.172099 228.327547l-6.654929 1.739981zM166.438712 184.812015c-14.334846 3.173966-24.573736 15.767831-24.675735 30.409673v387.540837a252.664286 252.664286 0 0 0 54.265417 160.033281c78.839153 96.039968 186.347998 164.436234 306.756705 194.947906a31.227665 31.227665 0 0 0 15.665832 0 582.458743 582.458743 0 0 0 312.899638-202.524825c34.606628-45.153515 53.139429-100.648919 52.422437-157.576307V215.732683A31.320664 31.320664 0 0 0 858.996273 185.323009 1596.402851 1596.402851 0 0 1 525.514855 72.286223a31.410663 31.410663 0 0 0-26.10872 0c-106.790853 49.146472-218.394654 86.826067-332.967423 112.525792" fill="#333333" p-id="3654"></path>
-</svg>
\ No newline at end of file
diff --git a/web/src/hooks/auth-hooks.ts b/web/src/hooks/auth-hooks.ts
index d65334103e..e744467270 100644
--- a/web/src/hooks/auth-hooks.ts
+++ b/web/src/hooks/auth-hooks.ts
@@ -14,61 +14,19 @@
* limitations under the License.
*/
-import message from '@/components/ui/message';
import authorizationUtil, {
type CredentialStorage,
} from '@/utils/authorization-util';
-import { useEffect, useMemo, useState } from 'react';
-import { useNavigate, useSearchParams } from 'react-router';
-
-export const useOAuthCallback = () => {
- const [currentQueryParameters, setSearchParams] = useSearchParams();
- const error = currentQueryParameters.get('error');
- const newQueryParameters: URLSearchParams = useMemo(
- () => new URLSearchParams(currentQueryParameters.toString()),
- [currentQueryParameters],
- );
- const navigate = useNavigate();
-
- useEffect(() => {
- if (error) {
- message.error(error);
- setTimeout(() => {
- navigate('/login');
- newQueryParameters.delete('error');
- setSearchParams(newQueryParameters);
- }, 1000);
- return;
- }
-
- const auth = currentQueryParameters.get('auth');
- if (auth) {
- authorizationUtil.setAuthorization(auth);
- newQueryParameters.delete('auth');
- setSearchParams(newQueryParameters);
- navigate('/');
- }
- }, [
- error,
- currentQueryParameters,
- newQueryParameters,
- navigate,
- setSearchParams,
- ]);
-
- console.debug(currentQueryParameters.get('auth'));
- return currentQueryParameters.get('auth');
-};
+import { useEffect, useState } from 'react';
export const useAuth = (
credentialStorage: CredentialStorage = authorizationUtil,
) => {
- const auth = useOAuthCallback();
const [isLogin, setIsLogin] = useState<Nullable<boolean>>(null);
useEffect(() => {
- setIsLogin(!!credentialStorage.getAuthorization() || !!auth);
- }, [auth, credentialStorage]);
+ setIsLogin(!!credentialStorage.getAuthorization());
+ }, [credentialStorage]);
return { isLogin };
};
diff --git a/web/src/hooks/use-login-request.ts b/web/src/hooks/use-login-request.ts
index b279280eb0..368730e1cf 100644
--- a/web/src/hooks/use-login-request.ts
+++ b/web/src/hooks/use-login-request.ts
@@ -16,16 +16,13 @@
import message from '@/components/ui/message';
import { Authorization } from '@/constants/authorization';
-import userService, {
- getLoginChannels,
- loginWithChannel,
-} from '@/services/user-service';
+import userService from '@/services/user-service';
import {
default as authorizationUtil,
redirectToLogin,
default as storage,
} from '@/utils/authorization-util';
-import { useMutation, useQuery } from '@tanstack/react-query';
+import { useMutation } from '@tanstack/react-query';
import { useTranslation } from 'react-i18next';
import { useSaveSetting } from './use-user-setting-request';
@@ -38,36 +35,6 @@ export interface IRegisterRequestBody extends ILoginRequestBody {
nickname: string;
}
-export interface ILoginChannel {
- channel: string;
- display_name: string;
- icon: string;
-}
-
-export const useLoginChannels = () => {
- const { data, isLoading } = useQuery({
- queryKey: ['loginChannels'],
- queryFn: async () => {
- const { data: res = {} } = await getLoginChannels();
- return res.data || [];
- },
- });
-
- return { channels: data as ILoginChannel[], loading: isLoading };
-};
-
-export const useLoginWithChannel = () => {
- const { isPending: loading, mutateAsync } = useMutation({
- mutationKey: ['loginWithChannel'],
- mutationFn: async (channel: string) => {
- loginWithChannel(channel);
- return Promise.resolve();
- },
- });
-
- return { loading, login: mutateAsync };
-};
-
export const useLogin = () => {
const { saveSetting } = useSaveSetting(true);
const {
diff --git a/web/src/pages/login-next/index.test.tsx b/web/src/pages/login-next/index.test.tsx
index 8d8d2e4201..28cd6976ac 100644
--- a/web/src/pages/login-next/index.test.tsx
+++ b/web/src/pages/login-next/index.test.tsx
@@ -13,8 +13,6 @@ jest.mock('@/hooks/auth-hooks', () => ({
jest.mock('@/hooks/use-login-request', () => ({
useLogin: () => ({ login: jest.fn(), loading: false }),
useRegister: () => ({ register: jest.fn(), loading: false }),
- useLoginChannels: () => ({ channels: [], loading: false }),
- useLoginWithChannel: () => ({ login: jest.fn(), loading: false }),
}));
jest.mock('react-router', () => ({
@@ -26,7 +24,6 @@ jest.mock('react-i18next', () => ({
}));
jest.mock('@/utils', () => ({ rsaPsw: jest.fn() }));
-jest.mock('@/components/svg-icon', () => () => null);
jest.mock('@/components/spotlight', () => () => null);
jest.mock('./bg', () => ({ BgSvg: () => null }));
jest.mock('./card', () => ({
diff --git a/web/src/pages/login-next/index.tsx b/web/src/pages/login-next/index.tsx
index 8663759d70..a04d76bf17 100644
--- a/web/src/pages/login-next/index.tsx
+++ b/web/src/pages/login-next/index.tsx
@@ -1,11 +1,5 @@
-import SvgIcon from '@/components/svg-icon';
import { useAuth } from '@/hooks/auth-hooks';
-import {
- useLogin,
- useLoginChannels,
- useLoginWithChannel,
- useRegister,
-} from '@/hooks/use-login-request';
+import { useLogin, useRegister } from '@/hooks/use-login-request';
import { useSystemConfig } from '@/hooks/use-system-request';
import { rsaPsw } from '@/utils';
import { useContext, useEffect, useState } from 'react';
@@ -41,10 +35,7 @@ type LoginFormContentProps = {
onCheck: (params: any) => Promise<void>;
changeTitle: () => void;
registerEnabled: boolean;
- channels: { channel: string; icon?: string; display_name: string }[];
- handleLoginWithChannel: (channel: string) => void;
t: ReturnType<typeof useTranslation>['t'];
- disablePasswordLogin?: boolean;
};
function LoginFormContent({
@@ -55,10 +46,7 @@ function LoginFormContent({
onCheck,
changeTitle,
registerEnabled,
- channels,
- handleLoginWithChannel,
t,
- disablePasswordLogin,
}: LoginFormContentProps) {
const face = useContext(FlipFaceContext);
const isActiveFace = isLoginPage ? face === 'front' : face === 'back';
@@ -71,25 +59,43 @@ function LoginFormContent({
</h2>
</div>
<div className=" w-full max-w-[540px] bg-bg-component backdrop-blur-sm rounded-2xl shadow-xl pt-14 pl-10 pr-10 pb-2 border border-border-button ">
- {!disablePasswordLogin && (
- <Form {...form}>
- <form
- className="flex flex-col gap-8 text-text-primary "
- data-testid="auth-form"
- data-active={isActiveFace ? 'true' : undefined}
- onSubmit={form.handleSubmit(onCheck)}
- >
+ <Form {...form}>
+ <form
+ className="flex flex-col gap-8 text-text-primary "
+ data-testid="auth-form"
+ data-active={isActiveFace ? 'true' : undefined}
+ onSubmit={form.handleSubmit(onCheck)}
+ >
+ <FormField
+ control={form.control}
+ name="email"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel required>{t('emailLabel')}</FormLabel>
+ <FormControl>
+ <Input
+ data-testid="auth-email"
+ placeholder={t('emailPlaceholder')}
+ autoComplete="email"
+ {...field}
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ {title === 'register' && (
<FormField
control={form.control}
- name="email"
+ name="nickname"
render={({ field }) => (
<FormItem>
- <FormLabel required>{t('emailLabel')}</FormLabel>
+ <FormLabel required>{t('nicknameLabel')}</FormLabel>
<FormControl>
<Input
- data-testid="auth-email"
- placeholder={t('emailPlaceholder')}
- autoComplete="email"
+ data-testid="auth-nickname"
+ placeholder={t('nicknamePlaceholder')}
+ autoComplete="username"
{...field}
/>
</FormControl>
@@ -97,120 +103,76 @@ function LoginFormContent({
</FormItem>
)}
/>
- {title === 'register' && (
- <FormField
- control={form.control}
- name="nickname"
- render={({ field }) => (
- <FormItem>
- <FormLabel required>{t('nicknameLabel')}</FormLabel>
- <FormControl>
- <Input
- data-testid="auth-nickname"
- placeholder={t('nicknamePlaceholder')}
- autoComplete="username"
- {...field}
- />
- </FormControl>
- <FormMessage />
- </FormItem>
- )}
- />
+ )}
+
+ <FormField
+ control={form.control}
+ name="password"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel required>{t('passwordLabel')}</FormLabel>
+ <FormControl>
+ <div className="relative">
+ <Input
+ data-testid="auth-password"
+ type={'password'}
+ placeholder={t('passwordPlaceholder')}
+ autoComplete={
+ title === 'login'
+ ? 'current-password'
+ : 'new-password'
+ }
+ {...field}
+ />
+ </div>
+ </FormControl>
+ <FormMessage />
+ </FormItem>
)}
+ />
+ {title === 'login' && (
<FormField
control={form.control}
- name="password"
+ name="remember"
render={({ field }) => (
<FormItem>
- <FormLabel required>{t('passwordLabel')}</FormLabel>
- <FormControl>
- <div className="relative">
- <Input
- data-testid="auth-password"
- type={'password'}
- placeholder={t('passwordPlaceholder')}
- autoComplete={
- title === 'login'
- ? 'current-password'
- : 'new-password'
- }
- {...field}
+ <div className="flex gap-2 group">
+ <FormControl>
+ <Checkbox
+ checked={field.value}
+ onCheckedChange={(checked) => {
+ field.onChange(checked);
+ }}
+ className="group-hover:border-border-default group-hover:bg-border-button"
/>
- </div>
- </FormControl>
+ </FormControl>
+ <FormLabel
+ className={cn('cursor-pointer', {
+ 'text-text-disabled': !field.value,
+ 'text-text-primary': field.value,
+ })}
+ >
+ {t('rememberMe')}
+ </FormLabel>
+ </div>
<FormMessage />
</FormItem>
)}
/>
+ )}
+ <ButtonLoading
+ data-testid="auth-submit"
+ type="submit"
+ loading={loading}
+ className="bg-metallic-gradient border-b-[#00BEB4] border-b-2 hover:bg-metallic-gradient hover:border-b-[#02bcdd] w-full my-8"
+ >
+ {title === 'login' ? t('login') : t('continue')}
+ </ButtonLoading>
+ </form>
+ </Form>
- {title === 'login' && (
- <FormField
- control={form.control}
- name="remember"
- render={({ field }) => (
- <FormItem>
- <div className="flex gap-2 group">
- <FormControl>
- <Checkbox
- checked={field.value}
- onCheckedChange={(checked) => {
- field.onChange(checked);
- }}
- className="group-hover:border-border-default group-hover:bg-border-button"
- />
- </FormControl>
- <FormLabel
- className={cn('cursor-pointer', {
- 'text-text-disabled': !field.value,
- 'text-text-primary': field.value,
- })}
- >
- {t('rememberMe')}
- </FormLabel>
- </div>
- <FormMessage />
- </FormItem>
- )}
- />
- )}
- <ButtonLoading
- data-testid="auth-submit"
- type="submit"
- loading={loading}
- className="bg-metallic-gradient border-b-[#00BEB4] border-b-2 hover:bg-metallic-gradient hover:border-b-[#02bcdd] w-full my-8"
- >
- {title === 'login' ? t('login') : t('continue')}
- </ButtonLoading>
- </form>
- </Form>
- )}
-
- {title === 'login' && channels && channels.length > 0 && (
- <div className={disablePasswordLogin ? 'py-8' : 'mt-3 border'}>
- {channels.map((item) => (
- <Button
- variant={'transparent'}
- key={item.channel}
- onClick={() => handleLoginWithChannel(item.channel)}
- style={{ marginTop: 10 }}
- className={disablePasswordLogin ? 'w-full' : ''}
- >
- <div className="flex items-center">
- <SvgIcon
- name={item.icon || 'sso'}
- width={20}
- height={20}
- style={{ marginRight: 5 }}
- />
- Sign in with {item.display_name}
- </div>
- </Button>
- ))}
- </div>
- )}
-
- {!disablePasswordLogin && title === 'login' && registerEnabled && (
+ {title === 'login' && registerEnabled && (
<div className="mt-10 text-right">
<p className="text-text-disabled text-sm">
{t('signInTip')}
@@ -225,7 +187,7 @@ function LoginFormContent({
</p>
</div>
)}
- {!disablePasswordLogin && title === 'register' && (
+ {title === 'register' && (
<div className="mt-10 text-right">
<p className="text-text-disabled text-sm">
{t('signUpTip')}
@@ -250,20 +212,13 @@ const Login = () => {
const navigate = useNavigate();
const { login, loading: signLoading } = useLogin();
const { register, loading: registerLoading } = useRegister();
- const { channels, loading: channelsLoading } = useLoginChannels();
- const { login: loginWithChannel, loading: loginWithChannelLoading } =
- useLoginWithChannel();
const { t } = useTranslation('translation', { keyPrefix: 'login' });
const { t: tSetting } = useTranslation('translation', {
keyPrefix: 'setting',
});
const [isLoginPage, setIsLoginPage] = useState(true);
- const loading =
- signLoading ||
- registerLoading ||
- channelsLoading ||
- loginWithChannelLoading;
+ const loading = signLoading || registerLoading;
const { config } = useSystemConfig();
const registerEnabled =
config?.registerEnabled === 1 || config?.registerEnabled === true;
@@ -275,10 +230,6 @@ const Login = () => {
}
}, [isLogin, navigate]);
- const handleLoginWithChannel = async (channel: string) => {
- await loginWithChannel(channel);
- };
-
const changeTitle = () => {
setIsLoginPage(title !== 'login');
if (title === 'login' && !registerEnabled) {
@@ -402,10 +353,7 @@ const Login = () => {
onCheck={onCheck}
changeTitle={changeTitle}
registerEnabled={registerEnabled}
- channels={channels || []}
- handleLoginWithChannel={handleLoginWithChannel}
t={t}
- disablePasswordLogin={!!config?.disablePasswordLogin}
/>
</FlipCard3D>
</div>
diff --git a/web/src/routes.tsx b/web/src/routes.tsx
index 1edf58054c..7168c8cca4 100644
--- a/web/src/routes.tsx
+++ b/web/src/routes.tsx
@@ -15,15 +15,9 @@
*/
import { lazy, memo, Suspense } from 'react';
-import {
- createBrowserRouter,
- Navigate,
- redirect,
- type RouteObject,
-} from 'react-router';
+import { createBrowserRouter, Navigate, type RouteObject } from 'react-router';
import FallbackComponent from './components/fallback-component';
import { IS_ENTERPRISE } from './pages/admin/utils';
-import authorizationUtil from './utils/authorization-util';
export enum Routes {
Root = '/',
@@ -169,16 +163,6 @@ const routeConfigOptions = [
path: Routes.Root,
layout: false,
Component: () => import('@/layouts/root-layout'),
- loader: ({ request }: { request: Request }) => {
- const url = new URL(request.url);
- const auth = url.searchParams.get('auth');
- if (auth) {
- authorizationUtil.setAuthorization(auth);
- url.searchParams.delete('auth');
- return redirect(`${url.pathname}${url.search}`);
- }
- return null;
- },
children: [
{
path: Routes.Root,
diff --git a/web/src/services/user-service.ts b/web/src/services/user-service.ts
index dc948e5903..d255a9d1b2 100644
--- a/web/src/services/user-service.ts
+++ b/web/src/services/user-service.ts
@@ -94,10 +94,6 @@ const methods = {
const userService = registerServer<keyof typeof methods>(methods, request);
-export const getLoginChannels = () => request.get(api.loginChannels);
-export const loginWithChannel = (channel: string) =>
- (window.location.href = api.loginChannel(channel));
-
export const listTenantUser = (tenantId: string) =>
request.get(api.listTenantUser(tenantId));
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index fd84419a58..9ae6aecc6b 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -27,8 +27,6 @@ export default {
setting: `${restAPIv1}/users/me`,
userInfo: `${restAPIv1}/users/me`,
tenantInfo: `${restAPIv1}/users/me/models`,
- loginChannels: `${restAPIv1}/auth/login/channels`,
- loginChannel: (channel: string) => `${restAPIv1}/auth/login/${channel}`,
// team
addTenantUser: (tenantId: string) => `${restAPIv1}/tenants/${tenantId}/users`,
diff --git a/web/src/utils/authorization-util.ts b/web/src/utils/authorization-util.ts
index c14ae8ffe2..ed27951810 100644
--- a/web/src/utils/authorization-util.ts
+++ b/web/src/utils/authorization-util.ts
@@ -56,9 +56,6 @@ const createCredentialStorage = (keys: CredentialKeys) => ({
const userInfoStr = localStorage.getItem(keys.userInfo);
return userInfoStr ? JSON.parse(userInfoStr) : null;
},
- setAuthorization: (value: string) => {
- localStorage.setItem(keys.authorization, value);
- },
saveLoginCredentials: (credentials: LoginCredentials) => {
localStorage.setItem(keys.authorization, credentials.authorization);
localStorage.setItem(keys.token, credentials.token);