mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-05-21 15:16:33 -04:00
Added in InstallId so that Kavita owned Email service can validate if requests are valid or not. (#1036)
This commit is contained in:
@@ -11,6 +11,7 @@ using API.DTOs;
|
||||
using API.DTOs.Account;
|
||||
using API.DTOs.Email;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using API.Errors;
|
||||
using API.Extensions;
|
||||
using API.Services;
|
||||
@@ -509,7 +510,8 @@ namespace API.Controllers
|
||||
await _emailService.SendPasswordResetEmail(new PasswordResetEmailDto()
|
||||
{
|
||||
EmailAddress = user.Email,
|
||||
ServerConfirmationLink = emailLink
|
||||
ServerConfirmationLink = emailLink,
|
||||
InstallId = (await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.InstallId)).Value
|
||||
});
|
||||
return Ok("Email sent");
|
||||
}
|
||||
@@ -560,7 +562,8 @@ namespace API.Controllers
|
||||
{
|
||||
EmailAddress = user.Email,
|
||||
Username = user.UserName,
|
||||
ServerConfirmationLink = emailLink
|
||||
ServerConfirmationLink = emailLink,
|
||||
InstallId = (await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.InstallId)).Value
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -5,4 +5,8 @@ public class ConfirmationEmailDto
|
||||
public string InvitingUser { get; init; }
|
||||
public string EmailAddress { get; init; }
|
||||
public string ServerConfirmationLink { get; init; }
|
||||
/// <summary>
|
||||
/// InstallId of this Kavita Instance
|
||||
/// </summary>
|
||||
public string InstallId { get; init; }
|
||||
}
|
||||
|
||||
@@ -5,4 +5,8 @@ public class EmailMigrationDto
|
||||
public string EmailAddress { get; init; }
|
||||
public string Username { get; init; }
|
||||
public string ServerConfirmationLink { get; init; }
|
||||
/// <summary>
|
||||
/// InstallId of this Kavita Instance
|
||||
/// </summary>
|
||||
public string InstallId { get; init; }
|
||||
}
|
||||
|
||||
@@ -4,4 +4,8 @@ public class PasswordResetEmailDto
|
||||
{
|
||||
public string EmailAddress { get; init; }
|
||||
public string ServerConfirmationLink { get; init; }
|
||||
/// <summary>
|
||||
/// InstallId of this Kavita Instance
|
||||
/// </summary>
|
||||
public string InstallId { get; init; }
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
|
||||
using API.Data;
|
||||
using API.DTOs.Email;
|
||||
using API.Entities.Enums;
|
||||
using API.Services.Tasks;
|
||||
using Flurl.Http;
|
||||
using Kavita.Common.EnvironmentInfo;
|
||||
using Kavita.Common.Helpers;
|
||||
|
||||
Reference in New Issue
Block a user