Skip to content

Commit

Permalink
Fixed login bug
Browse files Browse the repository at this point in the history
  • Loading branch information
scampower3 committed Dec 2, 2023
1 parent f9f7b7c commit 538bc73
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Jellyfin.Plugin.Tvdb/TvdbClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ private async Task LoginAsync()
{
if (string.IsNullOrEmpty(sdkClientSettings.AccessToken))
{
await loginClient.LoginAsync(new Body
var loginResponse = await loginClient.LoginAsync(new Body
{
Apikey = ApiKey,
Pin = ProjectApiKey
Apikey = ProjectApiKey,
Pin = ApiKey
}).ConfigureAwait(false);
_tokenUpdatedAt = DateTime.UtcNow;
sdkClientSettings.AccessToken = loginResponse.Data.Token;
}
}
finally
Expand All @@ -81,12 +82,13 @@ await loginClient.LoginAsync(new Body
await _tokenUpdateLock.WaitAsync().ConfigureAwait(false);
if (_tokenUpdatedAt < DateTime.UtcNow.Subtract(TimeSpan.FromDays(25)))
{
await loginClient.LoginAsync(new Body
var loginResponse = await loginClient.LoginAsync(new Body
{
Apikey = ApiKey,
Pin = ProjectApiKey
Apikey = ProjectApiKey,
Pin = ApiKey
}).ConfigureAwait(false);
_tokenUpdatedAt = DateTime.UtcNow;
sdkClientSettings.AccessToken = loginResponse.Data.Token;
}
}
finally
Expand Down

0 comments on commit 538bc73

Please sign in to comment.