@@ -29,7 +29,7 @@ public class StreamClient : IStreamClient
2929
3030 readonly RestClient _client ;
3131 readonly StreamClientOptions _options ;
32- readonly IStreamClientToken _streamClientToken ;
32+ readonly IToken _streamClientToken ;
3333 readonly string _apiKey ;
3434
3535 public StreamClient ( string apiKey , string apiSecretOrToken , StreamClientOptions options = null )
@@ -40,12 +40,12 @@ public StreamClient(string apiKey, string apiSecretOrToken, StreamClientOptions
4040 throw new ArgumentNullException ( "apiSecret" , "Must have an apiSecret or user session token" ) ;
4141
4242 _apiKey = apiKey ;
43- _streamClientToken = StreamClientToken . For ( apiSecretOrToken ) ;
43+ _streamClientToken = TokenFactory . For ( apiSecretOrToken ) ;
4444 _options = options ?? StreamClientOptions . Default ;
4545 _client = new RestClient ( GetBaseUrl ( _options . Location ) , TimeSpan . FromMilliseconds ( _options . Timeout ) ) ;
4646 }
4747
48- private StreamClient ( string apiKey , IStreamClientToken streamClientToken , RestClient client , StreamClientOptions options = null )
48+ private StreamClient ( string apiKey , IToken streamClientToken , RestClient client , StreamClientOptions options = null )
4949 {
5050 if ( string . IsNullOrWhiteSpace ( apiKey ) )
5151 throw new ArgumentNullException ( "apiKey" , "Must have an apiKey" ) ;
@@ -93,9 +93,9 @@ public async Task ActivityPartialUpdate(string id = null, ForeignIDTime foreignI
9393 await this . Batch . ActivitiesPartialUpdate ( new ActivityPartialUpdateRequestObject [ ] { update } ) ;
9494 }
9595
96- public string CreateUserSessionToken ( string userId , IDictionary < string , object > extraData = null )
96+ public string CreateUserToken ( string userId , IDictionary < string , object > extraData = null )
9797 {
98- return _streamClientToken . CreateUserSessionToken ( userId , extraData ) ;
98+ return _streamClientToken . CreateUserToken ( userId , extraData ) ;
9999 }
100100
101101 /// <summary>
@@ -174,7 +174,7 @@ private RestRequest BuildRestRequest(string fullPath, HttpMethod method, string
174174 var request = new RestRequest ( fullPath , method ) ;
175175 request . AddHeader ( "Authorization" , JWToken ( "*" , userID ) ) ;
176176 request . AddHeader ( "Stream-Auth-Type" , "jwt" ) ;
177- request . AddHeader ( "X-Stream-Client" , "stream-net-" + Version ) ;
177+ request . AddHeader ( "X-Stream-Client" , "stream-net-" + Version ) ;
178178 request . AddQueryParameter ( "api_key" , _apiKey ) ;
179179 return request ;
180180 }
0 commit comments