Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanayx committed Sep 19, 2023
1 parent 5c90dd4 commit 86bc11d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Pulsar.Client/Auth/Oauth2/AuthenticationOauth2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type internal AuthenticationOauth2(issuerUrl: Uri, audience: string, privateKey:
let! response = httpClient.GetStreamAsync metadataDataUrl
return! JsonSerializer.DeserializeAsync<Metadata> response
}
let getClient() =
let getTokenClient() =
backgroundTask {
let httpClient = httpClientFactory.CreateClient()
let! metadata = getMetadata httpClient issuerUrl
Expand Down Expand Up @@ -105,9 +105,9 @@ type internal AuthenticationOauth2(issuerUrl: Uri, audience: string, privateKey:
let newToken =
(backgroundTask {
let! credentials = openAndDeserializeCreds(privateKey.LocalPath)
let! tokenTaskResult = getClient()
let! tokenClient = getTokenClient()
return!
tokenTaskResult.ExchangeClientCredentials(
tokenClient.ExchangeClientCredentials(
credentials.ClientId,
credentials.ClientSecret,
audience,
Expand Down

0 comments on commit 86bc11d

Please sign in to comment.