diff --git a/CHANGELOG.md b/CHANGELOG.md index c60ab52c..5f72ca7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ### Changelog -#### Version - 3.6.1.0 - TBD +#### Version - 3.6.1.0 - 5/26/2024 +* Fixed a race condition on renewing Nexus Mods OAuth2 tokens * Added `set-nexus-api-key` CLI command * Added Starfield meta data -* Added Fallout New Vegas Epic Games meta data +* Added Fallout New Vegas Epic Games metadata #### Version - 3.6.0.0 - 5/25/2024 * Wabbajack now uses OAuth2 for Nexus Mods logins diff --git a/Wabbajack.Networking.NexusApi/NexusApi.cs b/Wabbajack.Networking.NexusApi/NexusApi.cs index bfc9f8d2..b512d265 100644 --- a/Wabbajack.Networking.NexusApi/NexusApi.cs +++ b/Wabbajack.Networking.NexusApi/NexusApi.cs @@ -33,6 +33,7 @@ public class NexusApi public readonly ITokenProvider AuthInfo; private DateTime _lastValidated; private (ValidateInfo info, ResponseMetadata header) _lastValidatedInfo; + private AsyncLock _authLock = new(); public NexusApi(ITokenProvider authInfo, ILogger logger, HttpClient client, IResource limiter, ApplicationInfo appInfo, JsonSerializerOptions jsonOptions) @@ -187,6 +188,7 @@ public class NexusApi protected virtual async ValueTask GenerateMessage(HttpMethod method, string uri, params object?[] parameters) { + using var _ = await _authLock.WaitAsync(); var msg = new HttpRequestMessage(); msg.Method = method;