Remove redundant check for empty JWT groups (#2323)

* Remove redundant check for empty group names in SetJWTGroups

* add test
This commit is contained in:
Bethuel Mmbaga
2024-07-26 17:33:54 +03:00
committed by GitHub
parent ea3205643a
commit 7321046cd6
2 changed files with 7 additions and 4 deletions

View File

@@ -770,10 +770,6 @@ func (a *Account) GetPeer(peerID string) *nbpeer.Peer {
// SetJWTGroups updates the user's auto groups by synchronizing JWT groups.
// Returns true if there are changes in the JWT group membership.
func (a *Account) SetJWTGroups(userID string, groupsNames []string) bool {
if len(groupsNames) == 0 {
return false
}
user, ok := a.Users[userID]
if !ok {
return false