lejianwen месяцев назад: 11
Родитель
Сommit
d486444680
3 измененных файлов с 5 добавлено и 1 удалено
  1. 1 0
      conf/config.yaml
  2. 1 0
      config/config.go
  3. 3 1
      http/controller/api/login.go

+ 1 - 0
conf/config.yaml

@@ -4,6 +4,7 @@ app:
4 4
   register: false #是否开启注册
5 5
   show-swagger: 0 # 1:启用 0:禁用
6 6
   token-expire: 360000
7
+  web-sso: true #web auth sso
7 8
 admin:
8 9
   title: "RustDesk Api Admin"
9 10
   hello-file: "./conf/admin/hello.html"  #优先使用file

+ 1 - 0
config/config.go

@@ -17,6 +17,7 @@ type App struct {
17 17
 	Register    bool `mapstructure:"register"`
18 18
 	ShowSwagger int  `mapstructure:"show-swagger"`
19 19
 	TokenExpire int  `mapstructure:"token-expire"`
20
+	WebSso      bool `mapstructure:"web-sso"`
20 21
 }
21 22
 type Admin struct {
22 23
 	Title     string `mapstructure:"title"`

+ 3 - 1
http/controller/api/login.go

@@ -85,7 +85,9 @@ func (l *Login) Login(c *gin.Context) {
85 85
 // @Router /login-options [get]
86 86
 func (l *Login) LoginOptions(c *gin.Context) {
87 87
 	ops := service.AllService.OauthService.GetOauthProviders()
88
-	ops = append(ops, model.OauthTypeWebauth)
88
+	if global.Config.App.WebSso {
89
+		ops = append(ops, model.OauthTypeWebauth)
90
+	}
89 91
 	var oidcItems []map[string]string
90 92
 	for _, v := range ops {
91 93
 		oidcItems = append(oidcItems, map[string]string{"name": v})