[#150] sdk/token: Add owner ID

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-17 18:04:04 +03:00 committed by Stanislav Bogatyrev
parent 73220620c5
commit 0259a06783
4 changed files with 104 additions and 34 deletions

View file

@ -70,10 +70,10 @@ func (c Client) createSessionV2(ctx context.Context, expiration uint64, opts ...
return nil, errors.New("malformed response body")
}
sessionToken, err := token.CreateSessionToken(body.GetID(), body.GetSessionKey())
if err != nil {
return nil, errors.Wrap(err, "malformed response body")
}
sessionToken := token.NewSessionToken()
sessionToken.SetID(body.GetID())
sessionToken.SetSessionKey(body.GetSessionKey())
sessionToken.SetOwnerID(ownerID)
return sessionToken, nil
default: