mirror of
https://github.com/1Panel-dev/KubePi.git
synced 2025-09-26 19:31:15 +08:00
fix: 解决 sso 数组越界的问题
This commit is contained in:
2
go.mod
2
go.mod
@@ -6,6 +6,7 @@ require (
|
||||
github.com/asdine/storm/v3 v3.2.1
|
||||
github.com/coreos/etcd v3.3.13+incompatible
|
||||
github.com/coreos/go-oidc v2.2.1+incompatible
|
||||
github.com/crewjam/saml v0.4.14
|
||||
github.com/docker/distribution v2.8.2+incompatible
|
||||
github.com/go-ldap/ldap/v3 v3.4.1
|
||||
github.com/gofrs/flock v0.8.1
|
||||
@@ -62,7 +63,6 @@ require (
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
|
||||
github.com/crewjam/httperr v0.2.0 // indirect
|
||||
github.com/crewjam/saml v0.4.14 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/docker/cli v24.0.6+incompatible // indirect
|
||||
|
2
go.sum
2
go.sum
@@ -1289,6 +1289,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
|
||||
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=
|
||||
gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=
|
||||
helm.sh/helm/v3 v3.14.2 h1:V71fv+NGZv0icBlr+in1MJXuUIHCiPG1hW9gEBISTIA=
|
||||
|
@@ -121,6 +121,9 @@ func (s *service) List(options common.DBOptions) (*v1Sso.Sso, error) {
|
||||
if err := db.All(&sso); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(sso) == 0 {
|
||||
return nil, errors.New("no such sso in db")
|
||||
}
|
||||
return &sso[0], nil
|
||||
}
|
||||
|
||||
@@ -223,7 +226,7 @@ func (s *service) OpenID(openid *v1Sso.OpenID, options common.DBOptions) (v1Sess
|
||||
_ = tx.Commit()
|
||||
fmt.Println("SSO用户" + claims.PreferredUsername + "不存在,已自动创建本地账号")
|
||||
} else {
|
||||
return v1Session.UserProfile{}, errors.New(fmt.Sprintf("query user %s failed ,: %s", claims.PreferredUsername, err.Error()))
|
||||
return v1Session.UserProfile{}, fmt.Errorf("query user %s failed ,: %s", claims.PreferredUsername, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ const UserManagement = {
|
||||
},
|
||||
{
|
||||
path: "sso",
|
||||
component: () => import("@/business/user-management/sso"),
|
||||
component: () => import("@/business/sso"),
|
||||
name: "SSO",
|
||||
requirePermission: {
|
||||
resource: "sso",
|
||||
|
Reference in New Issue
Block a user