mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
25 lines
1.3 KiB
C#
25 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Identity;
|
|
using Microsoft.AspNetCore.Identity.UI.Services;
|
|
|
|
namespace Aaru.Server.New.Components.Account;
|
|
|
|
// Remove the "else if (EmailSender is IdentityNoOpEmailSender)" block from RegisterConfirmation.razor after updating with a real implementation.
|
|
sealed class IdentityNoOpEmailSender : IEmailSender<IdentityUser>
|
|
{
|
|
readonly IEmailSender emailSender = new NoOpEmailSender();
|
|
|
|
public Task SendConfirmationLinkAsync(IdentityUser user, string email, string confirmationLink) =>
|
|
emailSender.SendEmailAsync(email,
|
|
"Confirm your email",
|
|
$"Please confirm your account by <a href='{confirmationLink}'>clicking here</a>.");
|
|
|
|
public Task SendPasswordResetLinkAsync(IdentityUser user, string email, string resetLink) =>
|
|
emailSender.SendEmailAsync(email,
|
|
"Reset your password",
|
|
$"Please reset your password by <a href='{resetLink}'>clicking here</a>.");
|
|
|
|
public Task SendPasswordResetCodeAsync(IdentityUser user, string email, string resetCode) =>
|
|
emailSender.SendEmailAsync(email,
|
|
"Reset your password",
|
|
$"Please reset your password using the following code: {resetCode}");
|
|
} |