mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 06:31:10 +01:00
Some fixups around error/warning in LDAP
This commit is contained in:
parent
3e5fe09dd0
commit
f5f9c098b7
@ -180,7 +180,7 @@ func (b *backend) Login(req *logical.Request, username string, password string)
|
||||
allgroups = append(allgroups, gname)
|
||||
}
|
||||
} else {
|
||||
resp.AddWarning("No group DN configured; only policies from locally-defined groups added")
|
||||
resp.AddWarning("no group DN configured; only policies from locally-defined groups available")
|
||||
}
|
||||
|
||||
for _, gname := range allgroups {
|
||||
@ -191,7 +191,12 @@ func (b *backend) Login(req *logical.Request, username string, password string)
|
||||
}
|
||||
|
||||
if len(policies) == 0 {
|
||||
resp.Data["error"] = "user is not a member of any authorized group"
|
||||
errStr := "user is not a member of any authorized group"
|
||||
if len(resp.Warnings()) > 0 {
|
||||
errStr = fmt.Sprintf("%s; additionally, %s", errStr, resp.Warnings()[0])
|
||||
}
|
||||
|
||||
resp.Data["error"] = errStr
|
||||
return nil, resp, nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user