feat: Web sso env (#125)
This commit is contained in:
@@ -4,6 +4,7 @@ app:
|
|||||||
register: false #是否开启注册
|
register: false #是否开启注册
|
||||||
show-swagger: 0 # 1:启用 0:禁用
|
show-swagger: 0 # 1:启用 0:禁用
|
||||||
token-expire: 360000
|
token-expire: 360000
|
||||||
|
web-sso: true #web auth sso
|
||||||
admin:
|
admin:
|
||||||
title: "RustDesk Api Admin"
|
title: "RustDesk Api Admin"
|
||||||
hello-file: "./conf/admin/hello.html" #优先使用file
|
hello-file: "./conf/admin/hello.html" #优先使用file
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ type App struct {
|
|||||||
Register bool `mapstructure:"register"`
|
Register bool `mapstructure:"register"`
|
||||||
ShowSwagger int `mapstructure:"show-swagger"`
|
ShowSwagger int `mapstructure:"show-swagger"`
|
||||||
TokenExpire int `mapstructure:"token-expire"`
|
TokenExpire int `mapstructure:"token-expire"`
|
||||||
|
WebSso bool `mapstructure:"web-sso"`
|
||||||
}
|
}
|
||||||
type Admin struct {
|
type Admin struct {
|
||||||
Title string `mapstructure:"title"`
|
Title string `mapstructure:"title"`
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ func (l *Login) Login(c *gin.Context) {
|
|||||||
// @Router /login-options [get]
|
// @Router /login-options [get]
|
||||||
func (l *Login) LoginOptions(c *gin.Context) {
|
func (l *Login) LoginOptions(c *gin.Context) {
|
||||||
ops := service.AllService.OauthService.GetOauthProviders()
|
ops := service.AllService.OauthService.GetOauthProviders()
|
||||||
ops = append(ops, model.OauthTypeWebauth)
|
if global.Config.App.WebSso {
|
||||||
|
ops = append(ops, model.OauthTypeWebauth)
|
||||||
|
}
|
||||||
var oidcItems []map[string]string
|
var oidcItems []map[string]string
|
||||||
for _, v := range ops {
|
for _, v := range ops {
|
||||||
oidcItems = append(oidcItems, map[string]string{"name": v})
|
oidcItems = append(oidcItems, map[string]string{"name": v})
|
||||||
|
|||||||
Reference in New Issue
Block a user