Files
Kayori 755c047693 Platform, plugin & account UX improvements
- Refactor handler dispatch to use a parsed GameModel instead of raw
  model strings (Handler.cs, HandlerService.cs, new GameModel.cs)
- Add a Unity asset-extraction subsystem (Abstractions/Extractors/Unity)
- Add WriteEventLogHandler, XrpcDouble serialization type
- Rename EaCoin*Handler -> *EaCoinHandler for naming consistency
- Add PIN/username update and forgot/reset password flows, with a
  console-logging IEmailSender until real email is wired up
- Add a settings page and a theming pass (theme tokens, tailwind config)
- Add plugin nav/route/UI-manifest frontend types
2026-09-06 15:12:50 +02:00

39 lines
1.5 KiB
C#

using Abstractions.Entities;
using Microsoft.AspNetCore.Identity;
using Server.Utils;
namespace Server.Services;
/// <summary>
/// Stand-in <see cref="IEmailSender{TUser}"/> that logs the link to the console instead of
/// actually sending an email. Wire up a real sender later; until then this keeps the Identity
/// API's register/forgotPassword flows usable during development.
/// </summary>
public class ConsoleEmailSender(ILogger<ConsoleEmailSender> logger)
: IEmailSender<User>
{
private readonly ILogger<ConsoleEmailSender> _logger = logger;
public Task SendConfirmationLinkAsync(User user, string email, string confirmationLink)
{
_logger.LogInformation("Confirmation link for {Email}: {Link}", email, confirmationLink);
return Task.CompletedTask;
}
public Task SendPasswordResetLinkAsync(User user, string email, string resetLink)
{
_logger.LogInformation("Password reset link for {Email}: {Link}", email, resetLink);
return Task.CompletedTask;
}
public Task SendPasswordResetCodeAsync(User user, string email, string resetCode)
{
var link = BuildResetPasswordLink(email, resetCode);
_logger.LogInformation("Password reset link for {Email}: {Link}", email, link);
return Task.CompletedTask;
}
private static string BuildResetPasswordLink(string email, string resetCode) =>
$"{ServerAddress.PublicUrl.TrimEnd('/')}/auth/resetPassword?email={Uri.EscapeDataString(email)}&code={Uri.EscapeDataString(resetCode)}";
}