mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-09 10:28:55 +08:00
新增LDAP认证方式
This commit is contained in:
@@ -159,8 +159,7 @@ func SetGroup(g *Group) error {
|
||||
if authType == "local" {
|
||||
g.Auth = defAuth
|
||||
} else {
|
||||
_, ok := authRegistry[authType]
|
||||
if !ok {
|
||||
if _, ok := authRegistry[authType]; !ok {
|
||||
return errors.New("未知的认证方式: " + authType)
|
||||
}
|
||||
auth := makeInstance(authType).(IUserAuth)
|
||||
@@ -168,6 +167,11 @@ func SetGroup(g *Group) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// 重置Auth, 删除多余的key
|
||||
g.Auth = map[string]interface{}{
|
||||
"type": authType,
|
||||
authType: g.Auth[authType],
|
||||
}
|
||||
}
|
||||
|
||||
g.UpdatedAt = time.Now()
|
||||
|
Reference in New Issue
Block a user