logger)
{
- _dbContext = dbContext;
+ _dbContextFactory = dbContextFactory;
_userManager = userManager;
_stripeSettings = stripeSettings.Value;
_logger = logger;
@@ -55,7 +55,8 @@ public class BillingService : IBillingService
_logger.LogWarning("Unrecognized Stripe Product ID: {ProductId} for user {Email}. Falling back to Free tier.", stripeProductId, customerEmail);
}
- var plan = await _dbContext.SubscriptionPlans.FirstOrDefaultAsync(p => p.PlanName == targetPlanName);
+ using var dbContext = await _dbContextFactory.CreateDbContextAsync();
+ var plan = await dbContext.SubscriptionPlans.FirstOrDefaultAsync(p => p.PlanName == targetPlanName);
if (plan != null)
{
user.SubscriptionPlanId = plan.Id;
@@ -82,7 +83,8 @@ public class BillingService : IBillingService
return false;
}
- var freePlan = await _dbContext.SubscriptionPlans.FirstOrDefaultAsync(p => p.PlanName == SubscriptionPlan.FreeName);
+ using var dbContext = await _dbContextFactory.CreateDbContextAsync();
+ var freePlan = await dbContext.SubscriptionPlans.FirstOrDefaultAsync(p => p.PlanName == SubscriptionPlan.FreeName);
if (freePlan != null)
{
user.SubscriptionPlanId = freePlan.Id;
diff --git a/src/NexusReader.Infrastructure/Services/KnowledgeService.cs b/src/NexusReader.Infrastructure/Services/KnowledgeService.cs
index fe4e529..2880aeb 100644
--- a/src/NexusReader.Infrastructure/Services/KnowledgeService.cs
+++ b/src/NexusReader.Infrastructure/Services/KnowledgeService.cs
@@ -7,7 +7,7 @@ using NexusReader.Application.Abstractions.Services;
using NexusReader.Application.DTOs.AI;
using NexusReader.Domain.Entities;
using NexusReader.Infrastructure.Helpers;
-using NexusReader.Infrastructure.Persistence;
+using NexusReader.Data.Persistence;
using Polly;
using Polly.Registry;
using Microsoft.Extensions.Options;
diff --git a/src/NexusReader.UI.Shared/Pages/Account/Login.razor b/src/NexusReader.UI.Shared/Pages/Account/Login.razor
index e006433..9635375 100644
--- a/src/NexusReader.UI.Shared/Pages/Account/Login.razor
+++ b/src/NexusReader.UI.Shared/Pages/Account/Login.razor
@@ -59,6 +59,13 @@
@_errorMessage
}
+
+
+
+