@@ -2012,10 +2012,10 @@ func (am *DefaultAccountManager) syncJWTGroups(ctx context.Context, accountID st
2012
2012
2013
2013
jwtGroupsNames := extractJWTGroups (ctx , settings .JWTGroupsClaimName , claims )
2014
2014
2015
- unlockPeer := am .Store .AcquireWriteLockByUID (ctx , accountID )
2015
+ unlockAccount := am .Store .AcquireWriteLockByUID (ctx , accountID )
2016
2016
defer func () {
2017
- if unlockPeer != nil {
2018
- unlockPeer ()
2017
+ if unlockAccount != nil {
2018
+ unlockAccount ()
2019
2019
}
2020
2020
}()
2021
2021
@@ -2024,12 +2024,12 @@ func (am *DefaultAccountManager) syncJWTGroups(ctx context.Context, accountID st
2024
2024
var hasChanges bool
2025
2025
var user * User
2026
2026
err = am .Store .ExecuteInTransaction (ctx , func (transaction Store ) error {
2027
- user , err = am . Store .GetUserByUserID (ctx , LockingStrengthShare , claims .UserId )
2027
+ user , err = transaction .GetUserByUserID (ctx , LockingStrengthShare , claims .UserId )
2028
2028
if err != nil {
2029
2029
return fmt .Errorf ("error getting user: %w" , err )
2030
2030
}
2031
2031
2032
- groups , err := am . Store .GetAccountGroups (ctx , accountID )
2032
+ groups , err := transaction .GetAccountGroups (ctx , accountID )
2033
2033
if err != nil {
2034
2034
return fmt .Errorf ("error getting account groups: %w" , err )
2035
2035
}
@@ -2087,8 +2087,8 @@ func (am *DefaultAccountManager) syncJWTGroups(ctx context.Context, accountID st
2087
2087
return fmt .Errorf ("error incrementing network serial: %w" , err )
2088
2088
}
2089
2089
}
2090
- unlockPeer ()
2091
- unlockPeer = nil
2090
+ unlockAccount ()
2091
+ unlockAccount = nil
2092
2092
2093
2093
return nil
2094
2094
})
0 commit comments