diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f5de92..a12e0b83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 - (Internal) Updated to Avalonia 11.0.9 ### Fixed - Fixed image viewer dialog arrow key navigation not working +- Fixed CivitAI login prompt not showing when downloading models that require CivitAI logins ## v2.9.0-pre.1 ### Added diff --git a/StabilityMatrix.Core/Services/DownloadService.cs b/StabilityMatrix.Core/Services/DownloadService.cs index 1aeeb9d7..ffc44ebf 100644 --- a/StabilityMatrix.Core/Services/DownloadService.cs +++ b/StabilityMatrix.Core/Services/DownloadService.cs @@ -1,4 +1,5 @@ -using System.Net.Http.Headers; +using System.Net; +using System.Net.Http.Headers; using Microsoft.Extensions.Logging; using Polly.Contrib.WaitAndRetry; using StabilityMatrix.Core.Attributes; @@ -184,6 +185,10 @@ public class DownloadService : IDownloadService throw new UnauthorizedAccessException(); } } + else if (noRedirectResponse.StatusCode == HttpStatusCode.Unauthorized) + { + throw new UnauthorizedAccessException(); + } using var redirectRequest = new HttpRequestMessage(); redirectRequest.Method = HttpMethod.Get;