Skip to content

Commit

Permalink
Adding debug info for user existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdt-rabobank committed Jan 25, 2024
1 parent f5d69f4 commit 464e6bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions uaa/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ func (u *Users) Exists(userName string) bool {

func (u *Users) GetByNameAndOrigin(userName, origin string) *User {
if u.userMap == nil {
lo.G.Debugf("GetByNameAndOrigin: No users found in UAA, returning NIL")
return nil
}
userList := u.userMap[strings.ToLower(userName)]
for _, user := range userList {
lo.G.Debugf("GetByNameAndOrigin: Checking user's origin [%s] for user [%s] against origin [%s]", user.Origin, user.Username, origin)
if strings.EqualFold(user.Origin, origin) {
lo.G.Debugf("GetByNameAndOrigin: Found user [%s] with origin [%s]", user.Username, origin)
return &user
}
}
lo.G.Debugf("GetByNameAndOrigin: No user found for [%s] with origin [%s], returning NIL", userName, origin)
return nil
}

Expand Down

0 comments on commit 464e6bd

Please sign in to comment.