services/session: Use user.ID.EncodeToString() where possible #1581

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-user-id into master 2024-12-25 18:09:37 +00:00
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody)
s.mtx.Lock() s.mtx.Lock()
s.tokens[key{ s.tokens[key{
tokenID: base58.Encode(uidBytes), tokenID: base58.Encode(uidBytes),
ownerID: base58.Encode(id.WalletBytes()), ownerID: id.EncodeToString(),
}] = storage.NewPrivateToken(&sk.PrivateKey, body.GetExpiration()) }] = storage.NewPrivateToken(&sk.PrivateKey, body.GetExpiration())
s.mtx.Unlock() s.mtx.Unlock()

View file

@ -41,7 +41,7 @@ func (s *TokenStore) Get(ownerID user.ID, tokenID []byte) *storage.PrivateToken
s.mtx.RLock() s.mtx.RLock()
t := s.tokens[key{ t := s.tokens[key{
tokenID: base58.Encode(tokenID), tokenID: base58.Encode(tokenID),
ownerID: base58.Encode(ownerID.WalletBytes()), ownerID: ownerID.EncodeToString(),
}] }]
s.mtx.RUnlock() s.mtx.RUnlock()