Fix: Recorte de URL Front Para Notificaciones.
This commit is contained in:
@@ -216,7 +216,7 @@ public class AdExpirationService : BackgroundService
|
||||
var notifService = scope.ServiceProvider.GetRequiredService<INotificationService>();
|
||||
|
||||
var config = scope.ServiceProvider.GetRequiredService<IConfiguration>();
|
||||
var frontendUrl = config["AppSettings:FrontendUrl"] ?? "http://localhost:5173";
|
||||
var frontendUrl = config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
|
||||
var cutoff = DateTime.UtcNow.AddHours(-24);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ public class IdentityService : IIdentityService
|
||||
await _v2Context.SaveChangesAsync();
|
||||
|
||||
// 4. Enviar Email REAL
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"] ?? "http://localhost:5173";
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
var verifyLink = $"{frontendUrl}/verificar-email?token={token}";
|
||||
|
||||
var emailBody = $@"
|
||||
@@ -187,7 +187,7 @@ public class IdentityService : IIdentityService
|
||||
await _v2Context.SaveChangesAsync();
|
||||
|
||||
// Email
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"] ?? "http://localhost:5173";
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
var verifyLink = $"{frontendUrl}/verificar-email?token={token}";
|
||||
|
||||
var emailBody = $@"
|
||||
@@ -241,7 +241,7 @@ public class IdentityService : IIdentityService
|
||||
|
||||
await _v2Context.SaveChangesAsync();
|
||||
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"] ?? "http://localhost:5173";
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
var resetLink = $"{frontendUrl}/restablecer-clave?token={token}";
|
||||
|
||||
var emailBody = $@"
|
||||
@@ -371,7 +371,7 @@ public class IdentityService : IIdentityService
|
||||
await _v2Context.SaveChangesAsync();
|
||||
|
||||
// Enviar Email al NUEVO correo
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"]?.Split(',')[0] ?? "http://localhost:5173";
|
||||
var frontendUrl = _config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
var link = $"{frontendUrl}/confirmar-cambio-email?token={token}";
|
||||
|
||||
var body = $@"
|
||||
|
||||
@@ -15,7 +15,7 @@ public class NotificationService : INotificationService
|
||||
_emailService = emailService;
|
||||
_logger = logger;
|
||||
// Leemos la URL del appsettings o usamos localhost como fallback
|
||||
_frontendUrl = config["AppSettings:FrontendUrl"] ?? "http://localhost:5173";
|
||||
_frontendUrl = config["AppSettings:FrontendUrl"]?.Split(',')[0].Trim() ?? "http://localhost:5173";
|
||||
}
|
||||
|
||||
private string GetEmailShell(string title, string content)
|
||||
|
||||
Reference in New Issue
Block a user