mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-01-08 07:11:48 +00:00
Merge pull request #99 from ejcx/evan/ro-98
Return error when attempting to delegate to non-existant user
This commit is contained in:
@@ -322,6 +322,13 @@ func Delegate(jsonIn []byte) ([]byte, error) {
|
||||
return jsonStatusError(err)
|
||||
}
|
||||
|
||||
// Make sure the user we are delegating to exists
|
||||
for _, user := range s.Users {
|
||||
if _, ok := records.GetRecord(user); !ok {
|
||||
err = errors.New("User not present")
|
||||
return jsonStatusError(err)
|
||||
}
|
||||
}
|
||||
// Find password record for user and verify that their password
|
||||
// matches. If not found then add a new entry for this user.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user